1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

GDScript: Return early when parsing invalid super call

This commit is contained in:
HolonProduction
2025-03-23 10:34:00 +01:00
parent 2303ce843a
commit b67dcb21fd
5 changed files with 29 additions and 1 deletions

View File

@@ -3301,7 +3301,11 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_call(ExpressionNode *p_pre
IdentifierNode *identifier = parse_identifier();
call->callee = identifier;
call->function_name = identifier->name;
consume(GDScriptTokenizer::Token::PARENTHESIS_OPEN, R"(Expected "(" after function name.)");
if (!consume(GDScriptTokenizer::Token::PARENTHESIS_OPEN, R"(Expected "(" after function name.)")) {
pop_multiline();
complete_extents(call);
return nullptr;
}
}
} else {
call->callee = p_previous_operand;

View File

@@ -0,0 +1,5 @@
[output]
include=[
; GDScript: class_a.notest.gd
{"display": "func_of_a()"},
]

View File

@@ -0,0 +1,7 @@
extends "res://completion/class_a.notest.gd"
func test():
super.
if true:
pass

View File

@@ -0,0 +1,5 @@
[output]
include=[
; GDScript: class_a.notest.gd
{"display": "func_of_a()"},
]

View File

@@ -0,0 +1,7 @@
extends "res://completion/class_a.notest.gd"
func test():
super.f
if true:
pass