Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDScript: Fix "Mismatched external parser" for autoloads #94131

Merged

Conversation

dalexeev
Copy link
Member

@dalexeev dalexeev commented Jul 9, 2024

MRP: autoload-path-mrp.zip

GDScript makes the assumption that some core APIs (like Resource.get_path(), ScriptServer, AutoloadInfo) return already simplified paths. I checked the usage and I think this is the most appropriate place to fix the bug.

This PR also resolves the inconsistency between parse() and parse_binary() introduced in #871241:

tokenizer = text_tokenizer;
tokenizer->set_cursor_position(cursor_line, cursor_column);
script_path = p_script_path.simplify_path();
current = tokenizer->scan();

tokenizer = buffer_tokenizer;
script_path = p_script_path;
current = tokenizer->scan();

Footnotes

  1. Formally, the bug was introduced in GDScript: Reintroduce binary tokenization on export #87634, since it was merged 1 day later. In any case, I think this is an accidental mistake due to parallel development.

@akien-mga akien-mga merged commit 26d1577 into godotengine:master Jul 9, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@dalexeev dalexeev deleted the gds-fix-mismatched-parser-autoloads branch July 9, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Parser bug: Mismatched external parser" due to autoload path including unnecessary ./
2 participants