- When generating symbols for `Variable`, if it IS `isExternal()` then do not symbol map, else symbol map
This commit is contained in:
Tristan B. Velloza Kildaire 2024-04-07 12:44:24 +02:00
parent 99de4fec22
commit 59edbde04d
1 changed files with 15 additions and 5 deletions

View File

@ -1194,13 +1194,23 @@ public final class DCodeEmitter : CodeEmitter
// Extract the Variable's type
Type varType = typeChecker.getType(var.context.container, var.getType());
// FIXME: Set proper scope type
string renamedSymbol = mapper.map(var, ScopeType.GLOBAL);
// Decide on the symbol's name
string symbolName;
// If it is NOT extern then map it
if(!var.isExternal())
{
// FIXME: Set proper scope type
symbolName = mapper.map(var, ScopeType.GLOBAL);
}
// If it is extern, then leave it as such
else
{
symbolName = var.getName();
}
// <type> <name>
signature = typeTransform(varType)~" "~renamedSymbol;
// TODO: Add extern here?
signature = typeTransform(varType)~" "~symbolName;
return signature;
}