mirror of https://github.com/tbklang/tlang.git
🐞️ 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:
parent
dbfea00f09
commit
fca2bac20e
|
@ -906,17 +906,9 @@ public final class Parser
|
||||||
/* Check if the first thing is a type */
|
/* Check if the first thing is a type */
|
||||||
if(getSymbolType(getCurrentToken()) == SymbolType.IDENT_TYPE)
|
if(getSymbolType(getCurrentToken()) == SymbolType.IDENT_TYPE)
|
||||||
{
|
{
|
||||||
/* Get the type (this can be doted) */
|
/* Get the type */
|
||||||
string type = getCurrentToken().getToken();
|
TypedEntity bogusEntity = parseTypedDeclaration(false, false, false, true);
|
||||||
nextToken();
|
string type = bogusEntity.getType();
|
||||||
|
|
||||||
/* If it is a star `*` */
|
|
||||||
while(getSymbolType(getCurrentToken()) == SymbolType.STAR)
|
|
||||||
{
|
|
||||||
// Make type a pointer
|
|
||||||
type = type~"*";
|
|
||||||
nextToken();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the identifier (This CAN NOT be dotted) */
|
/* Get the identifier (This CAN NOT be dotted) */
|
||||||
expect(SymbolType.IDENT_TYPE, getCurrentToken());
|
expect(SymbolType.IDENT_TYPE, getCurrentToken());
|
||||||
|
|
Loading…
Reference in New Issue