Fix consumeBoolean
This commit is contained in:
parent
bbb9896794
commit
aa485218db
@ -638,7 +638,7 @@ Parser.prototype.consumeDouble = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Parser.prototype.consumeBoolean = 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() {
|
Parser.prototype.matchWithEffect = function() {
|
||||||
@ -664,7 +664,7 @@ Parser.prototype.match = function(arg1, arg2) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Parser.prototype.consume = function(type) {
|
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++];
|
return this.tokens[this.position++];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user