diff options
author | kpdecker <kpdecker@gmail.com> | 2015-04-14 01:12:39 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-04-14 01:12:39 -0500 |
commit | 54e743a09a0e7524edd9e76c029eff53a90f9cba (patch) | |
tree | 816918e199201c19e81c15a72f64e8562e1163aa /src | |
parent | a7160a8d2745de95cb9da7d20ff02795b0d3f784 (diff) | |
download | handlebars.js-54e743a09a0e7524edd9e76c029eff53a90f9cba.zip handlebars.js-54e743a09a0e7524edd9e76c029eff53a90f9cba.tar.gz handlebars.js-54e743a09a0e7524edd9e76c029eff53a90f9cba.tar.bz2 |
Allow this references in literal statements
Fixes #967
Diffstat (limited to 'src')
-rw-r--r-- | src/handlebars.l | 2 | ||||
-rw-r--r-- | src/handlebars.yy | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/handlebars.l b/src/handlebars.l index 55d8efc..ff21283 100644 --- a/src/handlebars.l +++ b/src/handlebars.l @@ -110,7 +110,7 @@ ID [^\s!"#%-,\.\/;->@\[-\^`\{-~]+/{LOOKAHEAD} <mu>{ID} return 'ID'; -<mu>'['[^\]]*']' yytext = strip(1,2); return 'ID'; +<mu>'['[^\]]*']' return 'ID'; <mu>. return 'INVALID'; <INITIAL,mu><<EOF>> return 'EOF'; diff --git a/src/handlebars.yy b/src/handlebars.yy index 01ef7fb..d67a7da 100644 --- a/src/handlebars.yy +++ b/src/handlebars.yy @@ -94,11 +94,11 @@ hash ; hashSegment - : ID EQUALS param -> new yy.HashPair($1, $3, yy.locInfo(@$)) + : ID EQUALS param -> new yy.HashPair(yy.id($1), $3, yy.locInfo(@$)) ; blockParams - : OPEN_BLOCK_PARAMS ID+ CLOSE_BLOCK_PARAMS -> $2 + : OPEN_BLOCK_PARAMS ID+ CLOSE_BLOCK_PARAMS -> yy.id($2) ; helperName @@ -125,6 +125,6 @@ path ; pathSegments - : pathSegments SEP ID { $1.push({part: $3, separator: $2}); $$ = $1; } - | ID -> [{part: $1}] + : pathSegments SEP ID { $1.push({part: yy.id($3), original: $3, separator: $2}); $$ = $1; } + | ID -> [{part: yy.id($1), original: $1}] ; |