Finish compatibility with the old handlebars:

* foo"bar" is an invalid param
* {{foo}}bar{{/baz}} is invalid
* fix a number of issues with inverse sections
* add partials
This commit is contained in:
wycats
2010-12-03 16:49:04 -05:00
parent 9a6f77af56
commit f205cec745
8 changed files with 173 additions and 96 deletions
+6 -1
View File
@@ -69,7 +69,12 @@ Handlebars.HandlebarsLexer.prototype.lex = function() {
// All other cases are IDs or errors
} else {
// grab alphanumeric characters
while(this.peek().match(/[0-9A-Za-z\.]/)) { this.getchar() }
while(this.peek().match(/[_0-9A-Za-z\.]/)) { this.getchar() }
var peek = this.peek();
if(peek !== "}" && peek !== " " && peek !== "/") {
return
}
// if any characters were grabbed => ID
if(this.yytext.length) { return "ID" }