From c61f7f5e43fe2795bc10ca056f0083a9f9360e82 Mon Sep 17 00:00:00 2001 From: Lazy-Rabbit-2001 <2733679597@qq.com> Date: Sun, 13 Oct 2024 21:55:24 +0800 Subject: [PATCH] forgot to remove debug in ... --- modules/gdscript/gdscript_analyzer.cpp | 1 + modules/gdscript/gdscript_parser.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 70c9c6f8ffe9..83f9d354c186 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -1001,6 +1001,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class, member_node = member.function; action_name = "call"; member_type = "method"; + break; } if (member_node) { diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 85fe29227a63..f9b01f7f1b2f 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -100,8 +100,8 @@ GDScriptParser::GDScriptParser() { register_annotation(MethodInfo("@onready"), AnnotationInfo::VARIABLE, &GDScriptParser::onready_annotation); // Access restrictions. - register_annotation(MethodInfo("@private"), AnnotationInfo::CONSTANT | AnnotationInfo::VARIABLE | AnnotationInfo::FUNCTION , &GDScriptParser::access_private_annotation); - register_annotation(MethodInfo("@protected"), AnnotationInfo::CONSTANT | AnnotationInfo::VARIABLE | AnnotationInfo::FUNCTION , &GDScriptParser::access_protected_annotation); + register_annotation(MethodInfo("@private"), AnnotationInfo::CONSTANT | AnnotationInfo::VARIABLE | AnnotationInfo::FUNCTION, &GDScriptParser::access_private_annotation); + register_annotation(MethodInfo("@protected"), AnnotationInfo::CONSTANT | AnnotationInfo::VARIABLE | AnnotationInfo::FUNCTION, &GDScriptParser::access_protected_annotation); // Export annotations. register_annotation(MethodInfo("@export"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations); @@ -4183,8 +4183,7 @@ bool GDScriptParser::onready_annotation(AnnotationNode *p_annotation, Node *p_ta } // Access restrictions. -bool GDScriptParser::access_private_annotation(AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class) -{ +bool GDScriptParser::access_private_annotation(AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class) { AssignableNode *member = static_cast(p_target); switch (member->access_restriction) { @@ -4203,13 +4202,11 @@ bool GDScriptParser::access_private_annotation(AnnotationNode *p_annotation, Nod } member->access_restriction = Node::AccessRestriction::ACCESS_RESTRICTION_PRIVATE; - print_line(vformat(R"(Set access restriction of memebr %s to %s)", member->identifier->name, member->access_restriction)); return true; } -bool GDScriptParser::access_protected_annotation(AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class) -{ +bool GDScriptParser::access_protected_annotation(AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class) { AssignableNode *member = static_cast(p_target); switch (member->access_restriction) {