Multiple function declarations can now be parsed, previous error was due to exiting only when we were out of tokens, now we exit after consuming `}` after the call to parseBody()

expression_parsing
Tristan B. Kildaire 2 years ago
parent 0ea5b78a2f
commit 81a4c0537b

@ -243,6 +243,8 @@ public final class Parser
/* Parse the body (and it leaves ONLY when it gets the correct symbol, no expect needed) */
parseBody();
nextToken();
break;
}
else if (getSymbolType(getCurrentToken()) == SymbolType.COMMA)
{
@ -256,9 +258,9 @@ public final class Parser
gprintln("ParseFuncDef: ParameterDec: (Type: " ~ type ~ ", Identifier: " ~ identifier ~ ")",
DebugType.WARNING);
gprintln("ParseFuncDef: Parameter count: " ~ to!(string)(parameterCount));
}
gprintln("ParseFuncDef: Parameter count: " ~ to!(string)(parameterCount));
gprintln("parseFuncDef(): Leave", DebugType.WARNING);
}

@ -73,7 +73,7 @@ void main(int hello, byte d)
}
}
void k(int j)
void k(int j, int k)
{
}

Loading…
Cancel
Save