GodotScript.hpp: Fix GodotScript variables
Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
fa6ad19fe1
commit
333b15cfe0
@ -7,7 +7,11 @@ struct GsTarget: Target {
|
||||
unordered_task_map getTaskMap() final {
|
||||
return {
|
||||
make_task(Define<false>,
|
||||
output << (parseComponent.final ? "const " : "var ") << parseComponent.name << " = "; // TODO Handle redefining GodotScript variables
|
||||
const optional previous = parsedTree.findReferenceByName<Define<false>>(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 << parseComponent.name << " = ";
|
||||
transpileTree(parseComponent.content);
|
||||
),
|
||||
make_task(types::String, stringInterpolation(R"(""")", parseComponent.content);),
|
||||
|
Loading…
Reference in New Issue
Block a user