Fix consumeBoolean

This commit is contained in:
Victor 2015-12-07 21:28:44 +02:00
parent bbb9896794
commit aa485218db

View File

@ -638,7 +638,7 @@ Parser.prototype.consumeDouble = function() {
};
Parser.prototype.consumeBoolean = function() {
return "true" === (this.consume(TokenType.NUMBER).getText().toLowerCase());
return "true" === (this.consume(TokenType.WORD).getText().toLowerCase());
};
Parser.prototype.matchWithEffect = function() {
@ -664,7 +664,7 @@ Parser.prototype.match = function(arg1, arg2) {
};
Parser.prototype.consume = function(type) {
if (this.get(0).getType() !== type) throw "Ожидался токен " + type + ".";
if (this.get(0).getType() !== type) throw "Ожидался токен " + type + ", но получен " + this.get(0);
return this.tokens[this.position++];
};