From 348da1eaa3396bd31e04e32b34a21536eca3411b Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Tue, 8 Apr 2025 14:36:22 +0200 Subject: [PATCH] GodotScript.hpp: Fix GodotScript constants after the last commit Signed-off-by: Username404-59 --- src/headers/transpiler/implementations/GodotScript.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/headers/transpiler/implementations/GodotScript.hpp b/src/headers/transpiler/implementations/GodotScript.hpp index deb432c..363796d 100644 --- a/src/headers/transpiler/implementations/GodotScript.hpp +++ b/src/headers/transpiler/implementations/GodotScript.hpp @@ -9,7 +9,9 @@ struct GsTarget: Target { make_task(Define, const optional previous = parsedTree.findReferenceByName>(parseComponent.name); if (previous.has_value() and &previous.value().get() == &parseComponent) { // TODO Recursively traverse the parsedTree's parents and their parents to find existing definitions and do it in semantic analysis - output << (parseComponent.final ? "const " : "var "); + output << "var "; + } else if (parseComponent.final) { + output << "const "; } output << parseComponent.name << " = "; transpileTree(parseComponent.content);