From fbd07bf3bf04972fb1bbe289ba4f71784597a9e8 Mon Sep 17 00:00:00 2001 From: Stephen Nichols Date: Wed, 5 Aug 2020 14:42:33 -0500 Subject: Adding error message for empty grouping expression --- modules/gdscript/gdscript_parser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 79dc0313f1..a6fe2e67a7 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -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; } -- cgit v1.2.3