summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/ast.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-01-18 13:23:45 -0600
committerkpdecker <kpdecker@gmail.com>2015-01-18 13:23:45 -0600
commitcb51b82b8e8114aaa3e1b19c41e5c4eebf0539d5 (patch)
tree386038a4a43f85e19dfee0f996cce66f10c10d8f /lib/handlebars/compiler/ast.js
parentb0b522b4f81baf5ba4c190b59abd2b9cfe82bc77 (diff)
downloadhandlebars.js-cb51b82b8e8114aaa3e1b19c41e5c4eebf0539d5.zip
handlebars.js-cb51b82b8e8114aaa3e1b19c41e5c4eebf0539d5.tar.gz
handlebars.js-cb51b82b8e8114aaa3e1b19c41e5c4eebf0539d5.tar.bz2
Add support for dynamic partial names
Uses the subexpression syntax to allow for dynamic partial lookups. Ex: ``` {{> (helper) }} ``` Fixes #933
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r--lib/handlebars/compiler/ast.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index 113c03e..c193460 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -63,6 +63,15 @@ var AST = {
this.hash = hash;
},
+ PartialExpression: function(name, params, hash, locInfo) {
+ this.loc = locInfo;
+
+ this.type = 'PartialExpression';
+ this.name = name;
+ this.params = params || [];
+ this.hash = hash;
+ },
+
PathExpression: function(data, depth, parts, original, locInfo) {
this.loc = locInfo;
this.type = 'PathExpression';