Add support for INTEGER expressions

This commit is contained in:
tomhuda
2011-06-01 22:33:48 -07:00
parent 4eeda34ad2
commit 0f78345d0c
8 changed files with 71 additions and 30 deletions
+1
View File
@@ -24,6 +24,7 @@
<mu>"}}}" { this.begin("INITIAL"); return 'CLOSE'; }
<mu>"}}" { this.begin("INITIAL"); return 'CLOSE'; }
<mu>'"'("\\"["]|[^"])*'"' { yytext = yytext.substr(1,yyleng-2).replace(/\\"/g,'"'); return 'STRING'; }
<mu>[0-9]+/[}\s] { return 'INTEGER' }
<mu>[a-zA-Z0-9_$-]+/[=}\s/.] { return 'ID'; }
<mu>. { return 'INVALID'; }
+2
View File
@@ -68,6 +68,7 @@ params
param
: path { $$ = $1 }
| STRING { $$ = new yy.StringNode($1) }
| INTEGER { $$ = new yy.IntegerNode($1) }
;
hash
@@ -82,6 +83,7 @@ hashSegments
hashSegment
: ID EQUALS path { $$ = [$1, $3] }
| ID EQUALS STRING { $$ = [$1, new yy.StringNode($3)] }
| ID EQUALS INTEGER { $$ = [$1, new yy.IntegerNode($3)] }
;
path