summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortomhuda <tomhuda@strobecorp.com>2011-03-03 20:08:28 -0800
committertomhuda <tomhuda@strobecorp.com>2011-03-03 20:08:28 -0800
commit51d2543ba19639d0b0aa663caef31ae0e4ec3a74 (patch)
tree5c7248c5b4734a6d937db7559956dc32b7e706ca /src
parent32d7e52182414ae48ff82d4456d982049f0203a5 (diff)
downloadhandlebars.js-51d2543ba19639d0b0aa663caef31ae0e4ec3a74.zip
handlebars.js-51d2543ba19639d0b0aa663caef31ae0e4ec3a74.tar.gz
handlebars.js-51d2543ba19639d0b0aa663caef31ae0e4ec3a74.tar.bz2
Add support for {{foo.bar.baz}}
Diffstat (limited to 'src')
-rw-r--r--src/handlebars.l6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/handlebars.l b/src/handlebars.l
index 3166fbb..ef0d42c 100644
--- a/src/handlebars.l
+++ b/src/handlebars.l
@@ -16,12 +16,14 @@
<mu>"{{!".*?"}}" { yytext = yytext.substr(3,yyleng-5); this.begin("INITIAL"); return 'COMMENT'; }
<mu>"{{" { return 'OPEN'; }
-<mu>"/" { return 'SEP'; }
+<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>[a-zA-Z0-9_.]+/[} /] { return 'ID'; }
+<mu>[a-zA-Z0-9_]+/[} /.] { return 'ID'; }
<mu>. { return 'INVALID'; }
<INITIAL,mu><<EOF>> { return 'EOF'; }