Allow ID, STRING, or INTEGER for partial name

Fixes #519
This commit is contained in:
kpdecker
2013-05-29 10:46:28 -04:00
parent 3ddbc5237f
commit da2aabe7bd
8 changed files with 62 additions and 36 deletions
+2 -4
View File
@@ -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'; }
+3 -1
View File
@@ -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