From 17cd6347ba96d4e64cba475854e842e0a490a465 Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 10 Jun 2020 18:18:10 -0300 Subject: Add better local variable detection in GDScript parser Also store Variant operator to avoid needing to do it repeatedly in later compiling stages. --- modules/gdscript/gdscript_parser.h | 144 ++++++++++++++++++++++++++++++++----- 1 file changed, 128 insertions(+), 16 deletions(-) (limited to 'modules/gdscript/gdscript_parser.h') diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 0d775915cf..ec5e78bd4f 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -99,7 +99,9 @@ public: NATIVE, SCRIPT, CLASS, // GDScript. + VARIANT, // Can be any type. UNRESOLVED, + // TODO: Enum, Signal, Callable }; Kind kind = UNRESOLVED; @@ -113,14 +115,18 @@ public: bool is_constant = false; bool is_meta_type = false; - bool infer_type = false; + bool is_coroutine = false; // For function calls. Variant::Type builtin_type = Variant::NIL; StringName native_type; Ref