From fca2bac20e922f11325e75b01763b65c942afbe7 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Mon, 17 Apr 2023 16:34:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=EF=B8=8F=20Bugfix:=20Function=20pa?= =?UTF-8?q?rameter=20types=20should=20use=20parseTypedDeclaration(onlyType?= =?UTF-8?q?=3Dtrue)=20(#4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Praser - Added TODO in `parseFuncDef(bool)` explaining where we should place the type deriving code * Parser - Attempt "Solution 1" of `https://deavmi.assigned.network/git/tlang/tlang/issues/111` * Parser - Cleaned up `parseFuncDef()` - Also commented-out incorrect code that expected old type code for pointer handling * Parser - In `parseFuncDef()` we have removed commented out code which was, as mentioned in the last commit, incorrect code that expected old type code for pointer handling --- source/tlang/compiler/parsing/core.d | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/source/tlang/compiler/parsing/core.d b/source/tlang/compiler/parsing/core.d index 6820d50..134ad62 100644 --- a/source/tlang/compiler/parsing/core.d +++ b/source/tlang/compiler/parsing/core.d @@ -906,17 +906,9 @@ public final class Parser /* Check if the first thing is a type */ if(getSymbolType(getCurrentToken()) == SymbolType.IDENT_TYPE) { - /* Get the type (this can be doted) */ - string type = getCurrentToken().getToken(); - nextToken(); - - /* If it is a star `*` */ - while(getSymbolType(getCurrentToken()) == SymbolType.STAR) - { - // Make type a pointer - type = type~"*"; - nextToken(); - } + /* Get the type */ + TypedEntity bogusEntity = parseTypedDeclaration(false, false, false, true); + string type = bogusEntity.getType(); /* Get the identifier (This CAN NOT be dotted) */ expect(SymbolType.IDENT_TYPE, getCurrentToken());