From c9c0cdb32e7aafb922b9ae77f604ea34520f4d44 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 23 Dec 2015 14:40:06 +0200 Subject: [PATCH] Fix pre scan menu/if flags --- public_html/js/Parser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public_html/js/Parser.js b/public_html/js/Parser.js index 98de96b..3bc0fc8 100644 --- a/public_html/js/Parser.js +++ b/public_html/js/Parser.js @@ -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];