GDScript: Fix annotation parsing adding new annotation entries
This commit is contained in:
parent
92e51fca72
commit
140c6a612e
5 changed files with 19 additions and 7 deletions
|
@ -1624,6 +1624,7 @@ GDScriptParser::AnnotationNode *GDScriptParser::parse_annotation(uint32_t p_vali
|
|||
valid = false;
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
annotation->info = &valid_annotations[annotation->name];
|
||||
|
||||
if (!annotation->applies_to(p_valid_targets)) {
|
||||
|
@ -1634,6 +1635,7 @@ GDScriptParser::AnnotationNode *GDScriptParser::parse_annotation(uint32_t p_vali
|
|||
}
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (check(GDScriptTokenizer::Token::PARENTHESIS_OPEN)) {
|
||||
push_multiline(true);
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
@export
|
||||
func test():
|
||||
pass
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Annotation "@export" cannot be applied to a function.
|
|
@ -0,0 +1,3 @@
|
|||
@hello_world
|
||||
func test():
|
||||
pass
|
|
@ -0,0 +1,2 @@
|
|||
GDTEST_PARSER_ERROR
|
||||
Unrecognized annotation: "@hello_world".
|
Loading…
Reference in a new issue