Parse empty argument list in function call

This commit is contained in:
Alexander Luzgarev 2018-04-01 17:00:25 +02:00
parent 7d881d7f4a
commit 52a85be26c

View File

@ -250,11 +250,14 @@ namespace Parser
private FunctionCallParameterListNode ParseFunctionCallParameterList()
{
var first = ParseExpression();
var nodes = new List<SyntaxNode> { first };
while (CurrentToken.PureToken.Kind != TokenKind.ClosingBracket)
var nodes = new List<SyntaxNode>();
while (CurrentToken.Kind != TokenKind.ClosingBracket)
{
if (nodes.Count > 0)
{
nodes.Add(Factory.Token(EatToken(TokenKind.Comma)));
}
nodes.Add(ParseExpression());
}