diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-10-21 16:39:24 -0500 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-10-21 16:39:24 -0500 |
commit | 55aeff19dc10f4bea62c13c3621a62690fc11e34 (patch) | |
tree | dd037f78d42f699b102e8e9ba8390aa38eaf45f6 /modules/gdscript/gdscript_parser.cpp | |
parent | 1a9628f937751c3bf18ab4fd3292818037874f6d (diff) | |
parent | 140c6a612e9d9b04966d03fa2b36fbe29d473a38 (diff) | |
download | redot-engine-55aeff19dc10f4bea62c13c3621a62690fc11e34.tar.gz |
Merge pull request #98146 from HolonProduction/this-error-does-not-apply-to-unrecognized-annotations
GDScript: Fix annotation parsing adding new annotation entries
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 111a39d730..e30f03afad 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -1624,15 +1624,17 @@ GDScriptParser::AnnotationNode *GDScriptParser::parse_annotation(uint32_t p_vali valid = false; } - annotation->info = &valid_annotations[annotation->name]; + if (valid) { + annotation->info = &valid_annotations[annotation->name]; - if (!annotation->applies_to(p_valid_targets)) { - if (annotation->applies_to(AnnotationInfo::SCRIPT)) { - push_error(vformat(R"(Annotation "%s" must be at the top of the script, before "extends" and "class_name".)", annotation->name)); - } else { - push_error(vformat(R"(Annotation "%s" is not allowed in this level.)", annotation->name)); + if (!annotation->applies_to(p_valid_targets)) { + if (annotation->applies_to(AnnotationInfo::SCRIPT)) { + push_error(vformat(R"(Annotation "%s" must be at the top of the script, before "extends" and "class_name".)", annotation->name)); + } else { + push_error(vformat(R"(Annotation "%s" is not allowed in this level.)", annotation->name)); + } + valid = false; } - valid = false; } if (check(GDScriptTokenizer::Token::PARENTHESIS_OPEN)) { |