Fix up the compilation process

This commit is contained in:
wycats
2010-12-04 17:35:36 -05:00
parent f205cec745
commit 4db1abcd74
10 changed files with 190 additions and 118 deletions
+18 -18
View File
@@ -1,5 +1,6 @@
if(exports) { var Handlebars = {} }
var Handlebars = {};
// BEGIN(BROWSER)
Handlebars.Lexer = function() {};
Handlebars.Lexer.prototype = {
@@ -18,34 +19,34 @@ Handlebars.Lexer.prototype = {
getchar: function(n) {
n = n || 1;
var chars = "", char = "";
var chars = "", chr = "";
for(var i=0; i<n; i++) {
char = this.input[0];
chars += char;
this.yytext += char;
chr = this.input[0];
chars += chr;
this.yytext += chr;
this.yyleng++;
this.matched += char;
this.match += char;
this.matched += chr;
this.match += chr;
if(char === "\n") this.yylineno++;
if(chr === "\n") this.yylineno++;
this.input = this.input.slice(1);
}
return char;
return chr;
},
readchar: function(n, ignore) {
n = n || 1;
var char;
var chr;
for(var i=0; i<n; i++) {
char = this.input[i];
if(char === "\n") this.yylineno++;
chr = this.input[i];
if(chr === "\n") this.yylineno++;
this.matched += char;
this.match += char;
this.matched += chr;
this.match += chr;
if(ignore) { this.readchars++; }
}
@@ -87,8 +88,7 @@ Handlebars.Visitor.prototype = {
return this[object.type](object);
}
}
// END(BROWSER)
if(exports) {
exports.Lexer = Handlebars.Lexer;
exports.Visitor = Handlebars.Visitor;
}
exports.Lexer = Handlebars.Lexer;
exports.Visitor = Handlebars.Visitor;