Fix pre scan menu/if flags
This commit is contained in:
parent
3ed231e773
commit
c9c0cdb32e
@ -603,13 +603,14 @@ Parser.prototype.primary = function() {
|
||||
Parser.prototype.preScan = function() {
|
||||
// Сканируем все метки, для быстрого перехода командой jump.
|
||||
// А также определяем параметры для оптимизации.
|
||||
for (var i = 0; i < this.tokensCount - 2; i++) {
|
||||
for (var i = 0; i < this.tokensCount; i++) {
|
||||
var current = this.tokens[i].getType();
|
||||
if (current === TokenType.ENDMENU) {
|
||||
this.hasEndMenu = true;
|
||||
} else if (current === TokenType.ENDIF) {
|
||||
this.hasEndIf = true;
|
||||
} else if ( (current === TokenType.LABEL) &&
|
||||
((i + 2) < this.tokensCount) &&
|
||||
(this.tokens[i + 2].getType() === TokenType.COLON) ) {
|
||||
// label word :
|
||||
var token = this.tokens[i + 1];
|
||||
|
Loading…
Reference in New Issue
Block a user