summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortomhuda <tomhuda@tilde.io>2012-07-12 10:07:10 -0700
committertomhuda <tomhuda@tilde.io>2012-07-12 10:07:10 -0700
commitf79af6bfa3081187907c2615ddc3708915b5e44c (patch)
tree6dea69aaece417a85ab6445a32671d3119883423 /src
parent92b6c1401a95a1550524d264b1e5f4494f9a587f (diff)
parentefb1e25690e5c05b1d1662d72cac31f3cb90b67f (diff)
downloadhandlebars.js-f79af6bfa3081187907c2615ddc3708915b5e44c.zip
handlebars.js-f79af6bfa3081187907c2615ddc3708915b5e44c.tar.gz
handlebars.js-f79af6bfa3081187907c2615ddc3708915b5e44c.tar.bz2
Merge branch 'master' of github.com:wycats/handlebars.js
Diffstat (limited to 'src')
-rw-r--r--src/handlebars.l1
-rw-r--r--src/handlebars.yy3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/handlebars.l b/src/handlebars.l
index 592fd5c..f81fcdb 100644
--- a/src/handlebars.l
+++ b/src/handlebars.l
@@ -31,6 +31,7 @@
<mu>"}}}" { this.popState(); return 'CLOSE'; }
<mu>"}}" { this.popState(); return 'CLOSE'; }
<mu>'"'("\\"["]|[^"])*'"' { yytext = yytext.substr(1,yyleng-2).replace(/\\"/g,'"'); return 'STRING'; }
+<mu>"@"[a-zA-Z]+ { yytext = yytext.substr(1); return 'DATA'; }
<mu>"true"/[}\s] { return 'BOOLEAN'; }
<mu>"false"/[}\s] { return 'BOOLEAN'; }
<mu>[0-9]+/[}\s] { return 'INTEGER'; }
diff --git a/src/handlebars.yy b/src/handlebars.yy
index ec4fbe1..70b7777 100644
--- a/src/handlebars.yy
+++ b/src/handlebars.yy
@@ -58,6 +58,7 @@ inMustache
| path params { $$ = [[$1].concat($2), null]; }
| path hash { $$ = [[$1], $2]; }
| path { $$ = [[$1], null]; }
+ | DATA { $$ = [[new yy.DataNode($1)], null]; }
;
params
@@ -70,6 +71,7 @@ param
| STRING { $$ = new yy.StringNode($1); }
| INTEGER { $$ = new yy.IntegerNode($1); }
| BOOLEAN { $$ = new yy.BooleanNode($1); }
+ | DATA { $$ = new yy.DataNode($1); }
;
hash
@@ -86,6 +88,7 @@ hashSegment
| ID EQUALS STRING { $$ = [$1, new yy.StringNode($3)]; }
| ID EQUALS INTEGER { $$ = [$1, new yy.IntegerNode($3)]; }
| ID EQUALS BOOLEAN { $$ = [$1, new yy.BooleanNode($3)]; }
+ | ID EQUALS DATA { $$ = [$1, new yy.DataNode($3)]; }
;
path