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