Merge pull request #94131 from dalexeev/gds-fix-mismatched-parser-autoloads

GDScript: Fix "Mismatched external parser" for autoloads
This commit is contained in:
Rémi Verschelde 2024-07-09 16:47:32 +02:00
commit 26d1577f39
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 3 additions and 3 deletions

View file

@ -329,9 +329,9 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
String path = p_value;
if (path.begins_with("*")) {
autoload.is_singleton = true;
autoload.path = path.substr(1);
autoload.path = path.substr(1).simplify_path();
} else {
autoload.path = path;
autoload.path = path.simplify_path();
}
add_autoload(autoload);
} else if (p_name.operator String().begins_with("global_group/")) {

View file

@ -413,7 +413,7 @@ Error GDScriptParser::parse_binary(const Vector<uint8_t> &p_binary, const String
}
tokenizer = buffer_tokenizer;
script_path = p_script_path;
script_path = p_script_path.simplify_path();
current = tokenizer->scan();
// Avoid error or newline as the first token.
// The latter can mess with the parser when opening files filled exclusively with comments and newlines.