summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Nichols <snichols@certainaffinity.com>2020-08-05 14:42:33 -0500
committerStephen Nichols <snichols@certainaffinity.com>2020-08-05 14:42:33 -0500
commitfbd07bf3bf04972fb1bbe289ba4f71784597a9e8 (patch)
tree8c320f6e69e9a3783a26f0e0241c96215a9680d7
parent8a13be50abe929b1905b5e5ef72b199b60de13c3 (diff)
Adding error message for empty grouping expression
-rw-r--r--modules/gdscript/gdscript_parser.cpp6
1 files changed, 5 insertions, 1 deletions
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;
}