diff --git a/source/tlang/compiler/codegen/emit/dgen.d b/source/tlang/compiler/codegen/emit/dgen.d index c3e11621..b05075b4 100644 --- a/source/tlang/compiler/codegen/emit/dgen.d +++ b/source/tlang/compiler/codegen/emit/dgen.d @@ -48,8 +48,6 @@ public final class DCodeEmitter : CodeEmitter auto typedEntityVariable = context.tc.getResolver().resolveBest(context.getContainer(), varAs.varName); //TODO: Remove `auto` string typedEntityVariableName = context.tc.getResolver().generateName(context.getContainer(), typedEntityVariable); - - import compiler.codegen.mapper : SymbolMapper; string renamedSymbol = SymbolMapper.symbolLookup(context.getContainer(), typedEntityVariableName); @@ -84,7 +82,6 @@ public final class DCodeEmitter : CodeEmitter //NOTE: We may need to create a symbol table actually and add to that and use that as these names //could get out of hand (too long) // NOTE: Best would be identity-mapping Entity's to a name - import compiler.codegen.mapper : SymbolMapper; string renamedSymbol = SymbolMapper.symbolLookup(context.getContainer(), varDecInstr.varName); /* TODO: We might need to do a hold and emit */ diff --git a/source/tlang/compiler/typecheck/dependency/core.d b/source/tlang/compiler/typecheck/dependency/core.d index 60355f87..1758ae78 100644 --- a/source/tlang/compiler/typecheck/dependency/core.d +++ b/source/tlang/compiler/typecheck/dependency/core.d @@ -1275,10 +1275,13 @@ public class DNodeGenerator { VariableAssignmentStdAlone vAsStdAl = cast(VariableAssignmentStdAlone)entity; + /* Set the Context */ + vAsStdAl.setContext(context); + /* TODO: CHeck avriable name even */ - gprintln("VAGINA"); + gprintln("YEAST ENJOYER"); assert(tc.getResolver().resolveWithin(c, vAsStdAl.getVariableName())); - gprintln("VAGINA"); + gprintln("YEAST ENJOYER"); Variable variable = cast(Variable)tc.getResolver().resolveWithin(c, vAsStdAl.getVariableName()); assert(variable); /* Pool the variable */ diff --git a/source/tlang/testing/simple_variables.t b/source/tlang/testing/simple_variables.t index b9f58702..477838ce 100644 --- a/source/tlang/testing/simple_variables.t +++ b/source/tlang/testing/simple_variables.t @@ -1,5 +1,8 @@ -module simple_variables; +module simple_variables_decls_ass; int x = 1+2+2+1; -int y = 2; \ No newline at end of file +int y = 2; + +discard "TODO: Technically the below should not be allowed as we cannot do it in C - sadly"; +y = 5+5; diff --git a/source/tlang/testing/simple_variables_decls_ass.t b/source/tlang/testing/simple_variables_decls_ass.t new file mode 100644 index 00000000..736d2194 --- /dev/null +++ b/source/tlang/testing/simple_variables_decls_ass.t @@ -0,0 +1,5 @@ +module simple_variables_decls_ass; + + +int x = 1+2+2+1; +int y = 2; \ No newline at end of file