From da79f7f1d5bc3e5655248b440f3196c48953ceed Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Wed, 3 Mar 2021 18:18:08 +0200 Subject: [PATCH] Updated test cases Added string literal support for expressions --- source/tlang/compiler/parser.d | 9 ++++++++- source/tlang/testing/basic1.t | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source/tlang/compiler/parser.d b/source/tlang/compiler/parser.d index ce8664c..83f7434 100644 --- a/source/tlang/compiler/parser.d +++ b/source/tlang/compiler/parser.d @@ -189,6 +189,12 @@ public final class Parser } } + /* If it is a string literal */ + else if(symbol == SymbolType.STRING_LITERAL) + { + /* Get the next token */ + nextToken(); + } else { @@ -276,7 +282,8 @@ public final class Parser } else { - // gprintln("Error"); + gprintln("parse(): Geen idee", DebugType.ERROR); + exit(0); } } } diff --git a/source/tlang/testing/basic1.t b/source/tlang/testing/basic1.t index da208f1..b062664 100644 --- a/source/tlang/testing/basic1.t +++ b/source/tlang/testing/basic1.t @@ -5,5 +5,6 @@ ubyte k = 1; void main(int hello) { + ubyte thing = "Hello"; print("Hello world"); } \ No newline at end of file