Allowed function calls to have multiple arguments passed to them
parent
4610a2ba7b
commit
f693d71a8a
|
@ -914,10 +914,31 @@ public final class Parser
|
|||
/* If not expect arguments */
|
||||
else
|
||||
{
|
||||
/* TODO: SHould be allowing , seperated arguments */
|
||||
/* Parse an expression AND end on closing brace (expect) */
|
||||
arguments ~= parseExpression();
|
||||
expect(SymbolType.RBRACE, getCurrentToken());
|
||||
while(true)
|
||||
{
|
||||
/* Get the Expression */
|
||||
Expression exp = parseExpression();
|
||||
|
||||
/* Add it to list */
|
||||
arguments ~= exp;
|
||||
|
||||
/* Check if we exiting */
|
||||
if(getSymbolType(getCurrentToken()) == SymbolType.RBRACE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
/* If comma expect more */
|
||||
else if(getSymbolType(getCurrentToken()) == SymbolType.COMMA)
|
||||
{
|
||||
nextToken();
|
||||
/* TODO: If rbrace after then error, so save boolean */
|
||||
}
|
||||
/* TODO: Add else, could have exited on `;` which is invalid closing */
|
||||
else
|
||||
{
|
||||
expect("Function call closed on ;, invalid");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ int o = myModule.l;
|
|||
int f = f.L(f(1+f.d.d.d()));
|
||||
int p = f2p.j2.p;
|
||||
|
||||
int ll = f(1,1);
|
||||
|
||||
public ubyte k = 1;
|
||||
private ubyte k2 = 1;
|
||||
protected ubyte k3 = 1-1;
|
||||
|
|
Loading…
Reference in New Issue