From 14aafe7097d67adc74c8ec2ef4cac56c58927fb5 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Wed, 3 Mar 2021 23:10:21 +0200 Subject: [PATCH] Added some notes on refactoring the statement parsing system --- source/tlang/compiler/parser.d | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/source/tlang/compiler/parser.d b/source/tlang/compiler/parser.d index 76157da4..d4c7ac81 100644 --- a/source/tlang/compiler/parser.d +++ b/source/tlang/compiler/parser.d @@ -261,7 +261,19 @@ public final class Parser /* Get the next token */ nextToken(); } - /* TODO: Add funcCal symbol type */ + /* If it is an identifier */ + else if(symbol == SymbolType.IDENTIFIER) + { + string identifier = getCurrentToken().getToken(); + + nextToken(); + + /* If the symbol is `(` then function call */ + if(getSymbolType(getCurrentToken()) == SymbolType.LBRACE) + { + /* TODO: Implement function call */ + } + } else { gprintln("parseExpression(): NO MATCH", DebugType.ERROR); @@ -330,6 +342,19 @@ public final class Parser gprintln("ParseTypedDec: Je suis fini"); } + private void parseStatement() + { + /* TODO: Implement parse statement */ + + /** + * TODO: We should remove the `;` from parseFuncCall + * And rather do the following here: + * + * 1. parseFuncCall() + * 2. expect(;) + */ + } + private void parseFuncCall() { gprintln("parseFuncCall(): Doing function call parsing");