From 52a85be26c7580d37de6f08a0d9862ee5a36c6b3 Mon Sep 17 00:00:00 2001 From: Alexander Luzgarev Date: Sun, 1 Apr 2018 17:00:25 +0200 Subject: [PATCH] Parse empty argument list in function call --- Parser/MParser.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Parser/MParser.cs b/Parser/MParser.cs index 94ff0f1..631726d 100644 --- a/Parser/MParser.cs +++ b/Parser/MParser.cs @@ -250,11 +250,14 @@ namespace Parser private FunctionCallParameterListNode ParseFunctionCallParameterList() { - var first = ParseExpression(); - var nodes = new List { first }; - while (CurrentToken.PureToken.Kind != TokenKind.ClosingBracket) + var nodes = new List(); + while (CurrentToken.Kind != TokenKind.ClosingBracket) { - nodes.Add(Factory.Token(EatToken(TokenKind.Comma))); + if (nodes.Count > 0) + { + nodes.Add(Factory.Token(EatToken(TokenKind.Comma))); + } + nodes.Add(ParseExpression()); }