diff --git a/source/tlang/compiler/parser.d b/source/tlang/compiler/parser.d index a27721f..f3fa0f3 100644 --- a/source/tlang/compiler/parser.d +++ b/source/tlang/compiler/parser.d @@ -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"); + } + } } diff --git a/source/tlang/testing/basic1.t b/source/tlang/testing/basic1.t index af6c284..c1d89df 100644 --- a/source/tlang/testing/basic1.t +++ b/source/tlang/testing/basic1.t @@ -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;