From 8978a74a21f4a4e37a157b5f05729b7774604e3b Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Tue, 13 Dec 2022 11:41:25 +0200 Subject: [PATCH] Check - Updated SymbolType mappings ---- Test cases - Updated test case to test the above (`simple_variables.t`) --- source/tlang/compiler/symbols/check.d | 12 ++++++++++++ source/tlang/testing/simple_variables.t | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/tlang/compiler/symbols/check.d b/source/tlang/compiler/symbols/check.d index e1d742b0..cbe47e6b 100644 --- a/source/tlang/compiler/symbols/check.d +++ b/source/tlang/compiler/symbols/check.d @@ -470,6 +470,18 @@ public string getCharacter(SymbolType symbolIn) { return "+"; } + else if(symbolIn == SymbolType.STAR) + { + return "*"; + } + else if(symbolIn == SymbolType.SUB) + { + return "-"; + } + else if(symbolIn == SymbolType.DIVIDE) + { + return "/"; + } else { gprintln("getCharacter: No back-mapping for "~to!(string)(symbolIn), DebugType.ERROR); diff --git a/source/tlang/testing/simple_variables.t b/source/tlang/testing/simple_variables.t index 477838ce..0817fab0 100644 --- a/source/tlang/testing/simple_variables.t +++ b/source/tlang/testing/simple_variables.t @@ -1,7 +1,7 @@ module simple_variables_decls_ass; -int x = 1+2+2+1; +int x = 1+2*2/1-6; int y = 2; discard "TODO: Technically the below should not be allowed as we cannot do it in C - sadly";