You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
GDScript: Fix editor crash when writing @tool annotation
This commit is contained in:
@@ -494,6 +494,7 @@ void GDScriptParser::parse_program() {
|
|||||||
if (match(GDScriptTokenizer::Token::ANNOTATION)) {
|
if (match(GDScriptTokenizer::Token::ANNOTATION)) {
|
||||||
// Check for @tool annotation.
|
// Check for @tool annotation.
|
||||||
AnnotationNode *annotation = parse_annotation(AnnotationInfo::SCRIPT | AnnotationInfo::CLASS_LEVEL);
|
AnnotationNode *annotation = parse_annotation(AnnotationInfo::SCRIPT | AnnotationInfo::CLASS_LEVEL);
|
||||||
|
if (annotation != nullptr) {
|
||||||
if (annotation->name == "@tool") {
|
if (annotation->name == "@tool") {
|
||||||
// TODO: don't allow @tool anywhere else. (Should all script annotations be the first thing?).
|
// TODO: don't allow @tool anywhere else. (Should all script annotations be the first thing?).
|
||||||
_is_tool = true;
|
_is_tool = true;
|
||||||
@@ -506,6 +507,7 @@ void GDScriptParser::parse_program() {
|
|||||||
annotation_stack.push_back(annotation);
|
annotation_stack.push_back(annotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (bool should_break = false; !should_break;) {
|
for (bool should_break = false; !should_break;) {
|
||||||
// Order here doesn't matter, but there should be only one of each at most.
|
// Order here doesn't matter, but there should be only one of each at most.
|
||||||
|
|||||||
Reference in New Issue
Block a user