summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-12-31 13:31:47 -0600
committerkpdecker <kpdecker@gmail.com>2013-12-31 13:31:47 -0600
commitf2df220a1f8ecbf2f07ef5b9ba9a317a1d3d6dbc (patch)
treea7273e75ac19fb1fc4364ad9144259803d8b2c22
parenta2ca31bb193c5c6f073cfeef023feb9cc0e98ce5 (diff)
downloadhandlebars.js-f2df220a1f8ecbf2f07ef5b9ba9a317a1d3d6dbc.zip
handlebars.js-f2df220a1f8ecbf2f07ef5b9ba9a317a1d3d6dbc.tar.gz
handlebars.js-f2df220a1f8ecbf2f07ef5b9ba9a317a1d3d6dbc.tar.bz2
Add location tracking to sexpr
-rw-r--r--lib/handlebars/compiler/ast.js4
-rw-r--r--src/handlebars.yy4
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index ce5ee11..6ccd7f1 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -72,7 +72,9 @@ var AST = {
this.isHelper = this.sexpr.isHelper;
},
- SexprNode: function(rawParams, hash) {
+ SexprNode: function(rawParams, hash, locInfo) {
+ LocationInfo.call(this, locInfo);
+
this.type = "sexpr";
this.hash = hash;
diff --git a/src/handlebars.yy b/src/handlebars.yy
index 319b8ef..7bff512 100644
--- a/src/handlebars.yy
+++ b/src/handlebars.yy
@@ -71,8 +71,8 @@ simpleInverse
;
sexpr
- : path param* hash? -> new yy.SexprNode([$1].concat($2), $3)
- | dataName -> new yy.SexprNode([$1], null)
+ : path param* hash? -> new yy.SexprNode([$1].concat($2), $3, @$)
+ | dataName -> new yy.SexprNode([$1], null, @$)
;
param