summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2011-12-27 01:23:28 -0800
committerYehuda Katz <wycats@gmail.com>2011-12-27 01:23:28 -0800
commit932e2970ad29b16d6d6874ad0bfb44b07b4cd765 (patch)
tree41ce8d3556730bbefaba136d98e01356e26c8b00 /src
parent373d10edb1b3ff918c5d2c2965d2e243b05b1c21 (diff)
downloadhandlebars.js-932e2970ad29b16d6d6874ad0bfb44b07b4cd765.zip
handlebars.js-932e2970ad29b16d6d6874ad0bfb44b07b4cd765.tar.gz
handlebars.js-932e2970ad29b16d6d6874ad0bfb44b07b4cd765.tar.bz2
Realign lexer actions
Diffstat (limited to 'src')
-rw-r--r--src/handlebars.l46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/handlebars.l b/src/handlebars.l
index ec99edc..dd92cbf 100644
--- a/src/handlebars.l
+++ b/src/handlebars.l
@@ -6,30 +6,30 @@
[^\x00]*?/("{{") { this.begin("mu"); if (yytext) return 'CONTENT'; }
[^\x00]+ { return 'CONTENT'; }
-<mu>"{{>" { return 'OPEN_PARTIAL'; }
-<mu>"{{#" { return 'OPEN_BLOCK'; }
-<mu>"{{/" { return 'OPEN_ENDBLOCK'; }
-<mu>"{{^" { return 'OPEN_INVERSE'; }
-<mu>"{{"\s*"else" { return 'OPEN_INVERSE'; }
-<mu>"{{{" { return 'OPEN_UNESCAPED'; }
-<mu>"{{&" { return 'OPEN_UNESCAPED'; }
-<mu>"{{!"[\s\S]*?"}}" { yytext = yytext.substr(3,yyleng-5); this.begin("INITIAL"); return 'COMMENT'; }
-<mu>"{{" { return 'OPEN'; }
+<mu>"{{>" { return 'OPEN_PARTIAL'; }
+<mu>"{{#" { return 'OPEN_BLOCK'; }
+<mu>"{{/" { return 'OPEN_ENDBLOCK'; }
+<mu>"{{^" { return 'OPEN_INVERSE'; }
+<mu>"{{"\s*"else" { return 'OPEN_INVERSE'; }
+<mu>"{{{" { return 'OPEN_UNESCAPED'; }
+<mu>"{{&" { return 'OPEN_UNESCAPED'; }
+<mu>"{{!"[\s\S]*?"}}" { yytext = yytext.substr(3,yyleng-5); this.begin("INITIAL"); return 'COMMENT'; }
+<mu>"{{" { return 'OPEN'; }
-<mu>"=" { return 'EQUALS'; }
-<mu>"."/[} ] { return 'ID'; }
-<mu>".." { return 'ID'; }
-<mu>[\/.] { return 'SEP'; }
-<mu>\s+ { /*ignore whitespace*/ }
-<mu>"}}}" { this.begin("INITIAL"); return 'CLOSE'; }
-<mu>"}}" { this.begin("INITIAL"); return 'CLOSE'; }
-<mu>'"'("\\"["]|[^"])*'"' { yytext = yytext.substr(1,yyleng-2).replace(/\\"/g,'"'); return 'STRING'; }
-<mu>"true"/[}\s] { return 'BOOLEAN'; }
-<mu>"false"/[}\s] { return 'BOOLEAN'; }
-<mu>[0-9]+/[}\s] { return 'INTEGER'; }
-<mu>[a-zA-Z0-9_$-]+/[=}\s\/.] { return 'ID'; }
+<mu>"=" { return 'EQUALS'; }
+<mu>"."/[} ] { return 'ID'; }
+<mu>".." { return 'ID'; }
+<mu>[\/.] { return 'SEP'; }
+<mu>\s+ { /*ignore whitespace*/ }
+<mu>"}}}" { this.begin("INITIAL"); return 'CLOSE'; }
+<mu>"}}" { this.begin("INITIAL"); return 'CLOSE'; }
+<mu>'"'("\\"["]|[^"])*'"' { yytext = yytext.substr(1,yyleng-2).replace(/\\"/g,'"'); return 'STRING'; }
+<mu>"true"/[}\s] { return 'BOOLEAN'; }
+<mu>"false"/[}\s] { return 'BOOLEAN'; }
+<mu>[0-9]+/[}\s] { return 'INTEGER'; }
+<mu>[a-zA-Z0-9_$-]+/[=}\s\/.] { return 'ID'; }
<mu>\[[^\]]*\] { yytext = yytext.substr(1, yyleng-2); return 'ID'; }
-<mu>. { return 'INVALID'; }
+<mu>. { return 'INVALID'; }
-<INITIAL,mu><<EOF>> { return 'EOF'; }
+<INITIAL,mu><<EOF>> { return 'EOF'; }