Adding error message for empty grouping expression

This commit is contained in:
Stephen Nichols 2020-08-05 14:42:33 -05:00
parent 8a13be50ab
commit fbd07bf3bf

View file

@ -2328,7 +2328,11 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_dictionary(ExpressionNode
GDScriptParser::ExpressionNode *GDScriptParser::parse_grouping(ExpressionNode *p_previous_operand, bool p_can_assign) {
ExpressionNode *grouped = parse_expression(false);
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;
}