From 9b07884012cb14ae018239a4daea01a6361ff52c Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Wed, 1 Feb 2023 17:26:39 +0200 Subject: [PATCH] Instruction - Added TODO regarding access modifier of the `context` field - Added `setContext(Context)` for setting the context of the Instruction object --- source/tlang/compiler/codegen/instruction.d | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/tlang/compiler/codegen/instruction.d b/source/tlang/compiler/codegen/instruction.d index c2e248f0..23d55a94 100644 --- a/source/tlang/compiler/codegen/instruction.d +++ b/source/tlang/compiler/codegen/instruction.d @@ -11,7 +11,7 @@ import compiler.symbols.typing.core : Type; public class Instruction { /* Context for the Instruction (used in emitter for name resolution) */ - public Context context; + public Context context; //TODO: Make this private and add a setCOntext protected string addInfo; @@ -34,6 +34,11 @@ public class Instruction { return context; } + + public final void setContext(Context context) + { + this.context = context; + } } public class FetchInst : Instruction