🐞️ Bugfix: Function parameter types should use parseTypedDeclaration(onlyType=true) (#4)

* Praser

- Added TODO in `parseFuncDef(bool)` explaining where we should place the type deriving code

* Parser

- Attempt "Solution 1" of `#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
This commit is contained in:
Tristan B. Velloza Kildaire 2023-04-17 16:34:52 +02:00 committed by GitHub
parent dbfea00f09
commit fca2bac20e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 11 deletions

View File

@ -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());