diff options
author | Ryan Grove <ryan@wonko.com> | 2011-04-28 22:30:21 -0700 |
---|---|---|
committer | Ryan Grove <ryan@wonko.com> | 2011-04-28 22:30:21 -0700 |
commit | b324d002ca42a7a148b6b7d756319c8becc328fb (patch) | |
tree | 23a6e1a47d42c37c6a97890d4dca7790bdb18493 /src | |
parent | 038d9b3feed51bc12db95af0e0ef8b69776b42c9 (diff) | |
download | handlebars.js-b324d002ca42a7a148b6b7d756319c8becc328fb.zip handlebars.js-b324d002ca42a7a148b6b7d756319c8becc328fb.tar.gz handlebars.js-b324d002ca42a7a148b6b7d756319c8becc328fb.tar.bz2 |
Allow ids to contain hyphens. Fixes #36.
Previously, a mustache like {{foo-bar}} would generate a
parse error, which was a departure from the behavior of
other Mustache implementations.
Diffstat (limited to 'src')
-rw-r--r-- | src/handlebars.l | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/handlebars.l b/src/handlebars.l index e24e871..cb0d88b 100644 --- a/src/handlebars.l +++ b/src/handlebars.l @@ -24,7 +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>[a-zA-Z0-9_]+/[=} /.] { return 'ID'; } +<mu>[a-zA-Z0-9_-]+/[=} /.] { return 'ID'; } <mu>. { return 'INVALID'; } <INITIAL,mu><<EOF>> { return 'EOF'; } |