From 1e202fe78854b1dc7b4b9e15b9e02d3cb10abd5d Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Tue, 12 Apr 2022 10:52:18 +0200 Subject: [PATCH] Added Unary Oprator Instruction --- source/tlang/compiler/codegen/instruction.d | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source/tlang/compiler/codegen/instruction.d b/source/tlang/compiler/codegen/instruction.d index 314c25c3..6a5d91e9 100644 --- a/source/tlang/compiler/codegen/instruction.d +++ b/source/tlang/compiler/codegen/instruction.d @@ -130,6 +130,25 @@ public class BinOpInstr : Value } } +/** +* UnaryOpInstr instruction +* +* Any sort of Unary Operator +*/ +public class UnaryOpInstr : Value +{ + import compiler.symbols.data; + private Instruction exp; + private SymbolType operator; + + this(Instruction exp, SymbolType operator) + { + this.exp = exp; + + addInfo = "UnaryOpType: "~to!(string)(operator)~", Instr: "~exp.toString(); + } +} + /** * 2022 New things *