From aa485218dbbb7235756b1f0add5accdaf91370e5 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 7 Dec 2015 21:28:44 +0200 Subject: [PATCH] Fix consumeBoolean --- public_html/js/Parser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/js/Parser.js b/public_html/js/Parser.js index a393f0c..64bc355 100644 --- a/public_html/js/Parser.js +++ b/public_html/js/Parser.js @@ -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++]; };