- Added varAssStack (instance of Stack)
This commit is contained in:
Tristan B. Velloza Kildaire 2022-12-12 16:40:45 +02:00
parent 5ed48daab5
commit 90a302826b
1 changed files with 13 additions and 0 deletions

View File

@ -16,12 +16,21 @@ import compiler.typecheck.dependency.core : Context;
import compiler.codegen.mapper : SymbolMapper;
import compiler.symbols.data : SymbolType;
import compiler.symbols.check : getCharacter;
import misc.utils : Stack;
public final class DCodeEmitter : CodeEmitter
{
private Stack!(Instruction) varAssStack;
this(TypeChecker typeChecker, File file)
{
super(typeChecker, file);
varAssStack = new Stack!(Instruction)();
}
public override string transform(const Instruction instruction)
@ -62,6 +71,10 @@ public final class DCodeEmitter : CodeEmitter
import compiler.codegen.mapper : SymbolMapper;
string renamedSymbol = SymbolMapper.symbolLookup(context.getContainer(), varDecInstr.varName);
/* TODO: We might need to do a hold and emit */
return varDecInstr.varType~" "~renamedSymbol~";";
}
/* LiteralValue */