diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2023-10-05 13:50:26 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2023-10-05 13:50:26 +0300 |
commit | 9e2273abc7f24a7652889a1936b0d8ff71353d60 (patch) | |
tree | 105744795654a3a6c66533d3467c8e683a6959ae /modules/gdscript/gdscript_analyzer.cpp | |
parent | c7ed5d795ef396650e1e2853cf0d76cbdb1cb45e (diff) | |
download | redot-engine-9e2273abc7f24a7652889a1936b0d8ff71353d60.tar.gz |
GDScript: Add error when exporting node in non [Node]-derived classes
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index cdeaa70e5f..831971c3f3 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -910,7 +910,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class, for (GDScriptParser::AnnotationNode *&E : member_node->annotations) { if (E->name == SNAME("@warning_ignore")) { resolve_annotation(E); - E->apply(parser, member.variable); + E->apply(parser, member.variable, p_class); } } for (GDScriptWarning::Code ignored_warning : member_node->ignored_warnings) { @@ -933,7 +933,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class, for (GDScriptParser::AnnotationNode *&E : member.variable->annotations) { if (E->name != SNAME("@warning_ignore")) { resolve_annotation(E); - E->apply(parser, member.variable); + E->apply(parser, member.variable, p_class); } } @@ -985,7 +985,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class, // Apply annotations. for (GDScriptParser::AnnotationNode *&E : member.constant->annotations) { resolve_annotation(E); - E->apply(parser, member.constant); + E->apply(parser, member.constant, p_class); } } break; case GDScriptParser::ClassNode::Member::SIGNAL: { @@ -1015,7 +1015,7 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class, // Apply annotations. for (GDScriptParser::AnnotationNode *&E : member.signal->annotations) { resolve_annotation(E); - E->apply(parser, member.signal); + E->apply(parser, member.signal, p_class); } } break; case GDScriptParser::ClassNode::Member::ENUM: { @@ -1063,13 +1063,13 @@ void GDScriptAnalyzer::resolve_class_member(GDScriptParser::ClassNode *p_class, // Apply annotations. for (GDScriptParser::AnnotationNode *&E : member.m_enum->annotations) { resolve_annotation(E); - E->apply(parser, member.m_enum); + E->apply(parser, member.m_enum, p_class); } } break; case GDScriptParser::ClassNode::Member::FUNCTION: for (GDScriptParser::AnnotationNode *&E : member.function->annotations) { resolve_annotation(E); - E->apply(parser, member.function); + E->apply(parser, member.function, p_class); } resolve_function_signature(member.function, p_source); break; @@ -1279,7 +1279,7 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class, co // Apply annotations. for (GDScriptParser::AnnotationNode *&E : member.function->annotations) { resolve_annotation(E); - E->apply(parser, member.function); + E->apply(parser, member.function, p_class); } resolve_function_body(member.function); } else if (member.type == GDScriptParser::ClassNode::Member::VARIABLE && member.variable->property != GDScriptParser::VariableNode::PROP_NONE) { @@ -1301,7 +1301,7 @@ void GDScriptAnalyzer::resolve_class_body(GDScriptParser::ClassNode *p_class, co } else if (member.type == GDScriptParser::ClassNode::Member::GROUP) { // Apply annotation (`@export_{category,group,subgroup}`). resolve_annotation(member.annotation); - member.annotation->apply(parser, nullptr); + member.annotation->apply(parser, nullptr, p_class); } } @@ -1837,7 +1837,7 @@ void GDScriptAnalyzer::resolve_suite(GDScriptParser::SuiteNode *p_suite) { // Apply annotations. for (GDScriptParser::AnnotationNode *&E : stmt->annotations) { resolve_annotation(E); - E->apply(parser, stmt); + E->apply(parser, stmt, nullptr); } #ifdef DEBUG_ENABLED @@ -5544,7 +5544,7 @@ Error GDScriptAnalyzer::analyze() { // Apply annotations. for (GDScriptParser::AnnotationNode *&E : parser->head->annotations) { resolve_annotation(E); - E->apply(parser, parser->head); + E->apply(parser, parser->head, nullptr); } resolve_interface(); |