summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/handlebars.l6
-rw-r--r--src/handlebars.yy4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/handlebars.l b/src/handlebars.l
index 7fcf86e..2afd715 100644
--- a/src/handlebars.l
+++ b/src/handlebars.l
@@ -1,5 +1,5 @@
-%x mu emu com par
+%x mu emu com
%%
@@ -20,7 +20,7 @@
<com>[\s\S]*?"--}}" { yytext = yytext.substr(0, yyleng-4); this.popState(); return 'COMMENT'; }
-<mu>"{{>" { this.begin("par"); return 'OPEN_PARTIAL'; }
+<mu>"{{>" { return 'OPEN_PARTIAL'; }
<mu>"{{#" { return 'OPEN_BLOCK'; }
<mu>"{{/" { return 'OPEN_ENDBLOCK'; }
<mu>"{{^" { return 'OPEN_INVERSE'; }
@@ -58,8 +58,6 @@ Control characters ranges:
<mu>'['[^\]]*']' { yytext = yytext.substr(1, yyleng-2); return 'ID'; }
<mu>. { return 'INVALID'; }
-<par>\s+ { /*ignore whitespace*/ }
-<par>[a-zA-Z0-9_$\-\/\.]+ { this.popState(); return 'PARTIAL_NAME'; }
<INITIAL,mu><<EOF>> { return 'EOF'; }
diff --git a/src/handlebars.yy b/src/handlebars.yy
index 4e3a826..e521c2e 100644
--- a/src/handlebars.yy
+++ b/src/handlebars.yy
@@ -95,7 +95,9 @@ hashSegment
;
partialName
- : PARTIAL_NAME { $$ = new yy.PartialNameNode($1); }
+ : path { $$ = new yy.PartialNameNode($1); }
+ | STRING { $$ = new yy.PartialNameNode(new yy.StringNode($1)); }
+ | INTEGER { $$ = new yy.PartialNameNode(new yy.IntegerNode($1)); }
;
dataName