From 930cb8853cdb49556903f2657d67029ce8c3d665 Mon Sep 17 00:00:00 2001 From: ncannasse Date: Thu, 23 Nov 2017 11:34:44 +0100 Subject: [PATCH] don't reset line + preprocessor fix --- hscript/Parser.hx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hscript/Parser.hx b/hscript/Parser.hx index 289a4e5..20ea34e 100644 --- a/hscript/Parser.hx +++ b/hscript/Parser.hx @@ -154,7 +154,7 @@ class Parser { } function initParser( origin ) { - line = 1; + // line=1 - don't reset line : it might be set manualy preprocStack = []; #if hscriptPos this.origin = origin; @@ -1439,7 +1439,8 @@ class Parser { skipTokens(); return token(); } else if( id == "else" ) { - preprocStack[preprocStack.length - 1].r = true; + preprocStack.pop(); + preprocStack.push({ r : true }); return token(); } else { // elseif