Fix the lexer to handle Strings with escaped quotes

This commit is contained in:
wycats
2010-11-25 11:54:09 -08:00
parent 83fa737e04
commit 3388962225
+3 -3
View File
@@ -27,9 +27,9 @@ Handlebars.HandlebarsLexer.prototype.lex = function() {
if(this.peek() == "}") this.getchar();
return "CLOSE";
} else if(this.peek() === '"') {
this.getchar();
while(this.peek() !== '"') { this.getchar() }
this.getchar();
this.readchar();
while(this.peek() !== '"') { if(this.peek(2) === '\\"') { this.readchar() }; this.getchar() }
this.readchar();
return "STRING";
} else {
while(this.peek().match(/[A-Za-z]/)) { this.getchar() }