From 761439aee8cb2c1c93e0bd747975987d635aab4e Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Fri, 31 May 2024 09:49:08 +0200 Subject: [PATCH] Evaluate global before guessing current package --- hld/Eval.hx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hld/Eval.hx b/hld/Eval.hx index d03b369..7cca9d8 100644 --- a/hld/Eval.hx +++ b/hld/Eval.hx @@ -743,16 +743,20 @@ class Eval { } } + // global + var g = getGlobalAddress([name]); + if( g != ANone ) + return g; + // global (current package) if( tpack != null && tpack.length > 0 ) { tpack.push(name); var g = getGlobalAddress(tpack); - if( g != null ) + if( g != ANone ) return g; } - // global - return getGlobalAddress([name]); + return ANone; } function evalPath( path : Array ) : Value {