private static ArgumentsList ParseArgumentList(Scope scope, LuaLexer code) { FetchToken(LuaToken.BracketOpen, code); // exprArgumentList := '(' [ exprArg { , exprArg } ] ')' var argumentsList = new ArgumentsList(); while (code.Current.Typ != LuaToken.BracketClose) { Token tName = null; if (code.LookAhead.Typ == LuaToken.Assign) // named argument { tName = FetchToken(LuaToken.Identifier, code); code.Next(); // equal } // parse the expression var tFirst = code.Current; var expr = ParseExpression(scope, code, InvokeResult.LuaResult, scope.EmitExpressionDebug); if (tName == null) argumentsList.AddPositionalArgument(tFirst, expr); else argumentsList.AddNamedArgument(tName, expr); // optinal comma FetchToken(LuaToken.Comma, code, true); } code.Next(); return argumentsList; }