Parse empty argument list in function description

This commit is contained in:
Alexander Luzgarev 2018-04-01 16:47:04 +02:00
parent ddd52f169d
commit 7d881d7f4a

View File

@ -173,10 +173,14 @@ namespace Parser
private ParameterListNode ParseParameterList()
{
var identifierTokens = new List<Token>();
identifierTokens.Add(EatToken(TokenKind.Identifier));
while (CurrentToken.PureToken.Kind != TokenKind.ClosingBracket)
while (CurrentToken.Kind != TokenKind.ClosingBracket)
{
if (identifierTokens.Count > 0)
{
identifierTokens.Add(EatToken(TokenKind.Comma));
}
identifierTokens.Add(EatToken(TokenKind.Identifier));
}