diff options
author | kpdecker <kpdecker@gmail.com> | 2014-11-27 08:37:48 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-11-27 08:37:48 -0600 |
commit | 1124908d2a0d36493912eb2ce062545b1b5e5445 (patch) | |
tree | f6f8a5f5f0a96a6aa4152aeb576775021c390390 /lib/handlebars/compiler/ast.js | |
parent | e1cba432a68fe208782f8f943ebd57d7641d705a (diff) | |
download | handlebars.js-1124908d2a0d36493912eb2ce062545b1b5e5445.zip handlebars.js-1124908d2a0d36493912eb2ce062545b1b5e5445.tar.gz handlebars.js-1124908d2a0d36493912eb2ce062545b1b5e5445.tar.bz2 |
Update subexpression and hash AST constructs
Diffstat (limited to 'lib/handlebars/compiler/ast.js')
-rw-r--r-- | lib/handlebars/compiler/ast.js | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js index 7530074..2439571 100644 --- a/lib/handlebars/compiler/ast.js +++ b/lib/handlebars/compiler/ast.js @@ -66,17 +66,10 @@ var AST = { SexprNode: function(rawParams, hash, locInfo) { this.loc = locInfo; - this.type = "sexpr"; - this.hash = hash; - - this.id = rawParams[0]; + this.type = 'SubExpression'; + this.path = rawParams[0]; this.params = rawParams.slice(1); - }, - - HashNode: function(pairs, locInfo) { - this.loc = locInfo; - this.type = "hash"; - this.pairs = pairs; + this.hash = hash; }, PathNode: function(data, parts, locInfo) { @@ -128,6 +121,18 @@ var AST = { this.loc = locInfo; this.type = 'BooleanLiteral'; this.value = bool === 'true'; + }, + + HashNode: function(pairs, locInfo) { + this.loc = locInfo; + this.type = 'Hash'; + this.pairs = pairs; + }, + HashPair: function(key, value, locInfo) { + this.loc = locInfo; + this.type = 'HashPair'; + this.key = key; + this.value = value; } }; |