Adding error message for empty grouping expression
This commit is contained in:
parent
8a13be50ab
commit
fbd07bf3bf
1 changed files with 5 additions and 1 deletions
|
@ -2328,7 +2328,11 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode
|
||||||
GDScriptParser::ExpressionNode *GDScriptParser::parse_grouping(ExpressionNode *p_previous_operand, bool p_can_assign) {
|
GDScriptParser::ExpressionNode *GDScriptParser::parse_grouping(ExpressionNode *p_previous_operand, bool p_can_assign) {
|
||||||
ExpressionNode *grouped = parse_expression(false);
|
ExpressionNode *grouped = parse_expression(false);
|
||||||
pop_multiline();
|
pop_multiline();
|
||||||
consume(GDScriptTokenizer::Token::PARENTHESIS_CLOSE, R"*(Expected closing ")" after grouping expression.)*");
|
if (grouped == nullptr) {
|
||||||
|
push_error(R"(Expected grouping expression.)");
|
||||||
|
} else {
|
||||||
|
consume(GDScriptTokenizer::Token::PARENTHESIS_CLOSE, R"*(Expected closing ")" after grouping expression.)*");
|
||||||
|
}
|
||||||
return grouped;
|
return grouped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue