From 2c7c04e803aef5c7dd186a287efc37c9961544b2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 16 Oct 2016 09:31:03 +0200 Subject: [PATCH] - when simplifying a non-constant expression, leave any identifier that cannot be trivially simplified to a constant alone. It is better to defer resolution to more context-aware code for those. --- src/scripting/zscript/zcc_compile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index 6d0295696..e184ccaa1 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -1009,7 +1009,7 @@ ZCC_Expression *ZCCCompiler::IdentifyIdentifier(ZCC_ExprID *idnode, PSymbolTable return node; } } - else + else if (SimplifyingConstant) // leave unknown identifiers alone when simplifying non-constants. It is impossible to know what they are here. { // Also handle line specials. // To call this like a function this needs to be done differently, but for resolving constants this is ok.