Handle empty call
This commit is contained in:
@@ -501,6 +501,7 @@ shared_ptr<Expression> Parser::matchExpressionCall() {
|
||||
currentIndex++; // left parenthesis
|
||||
|
||||
vector<shared_ptr<Expression>> argumentExpressions;
|
||||
if (!tryMatchingTokenKinds({TokenKind::RIGHT_PAREN}, true, true)) {
|
||||
do {
|
||||
tryMatchingTokenKinds({TokenKind::NEW_LINE}, true, true); // optional new line
|
||||
|
||||
@@ -515,6 +516,7 @@ shared_ptr<Expression> Parser::matchExpressionCall() {
|
||||
markError(TokenKind::RIGHT_PAREN, {});
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return make_shared<ExpressionCall>(identifierToken->getLexme(), argumentExpressions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user