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

"Parser bug: Mismatched external parser" due to autoload path including unnecessary ./ #94098

Closed
akien-mga opened this issue Jul 8, 2024 · 8 comments · Fixed by #94131
Closed

Comments

@akien-mga
Copy link
Member

Tested versions

  • Reproducible in 4.3.beta (16f98cd)
  • Reproducible in 4.3.dev4 to 4.3.beta2
  • Not reproducible in 4.3.dev3 and earlier dev snapshots, or 4.2.2.stable

System information

Fedora Linux 40 (KDE Plasma) - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7600M XT (RADV NAVI33) - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 Threads)

Issue description

Copying @Glorax's report from #92233, which was another bug with similar symptoms.
But this one happens straight in the editor.

The Cogito project template raises a bunch of parser errors in 4.3.dev4 and later.

Screenshot 2024-07-07 at 10 16 16 PM
resolve_class_member: Parser bug: Mismatched external parser.
<C++ Error>    Condition "!parser_ref->get_parser()->has_class(p_class)" is true.
<C++ Source>   modules/gdscript/gdscript_analyzer.cpp:909 @ resolve_class_member()

Steps to reproduce

  • Open Cogito project with zip linked below
  • After initial import, restart
  • See "Parser errors" on the main scene or when loading one of the demo scenes

Minimal reproduction project (MRP)

Not minimal, but triggers the error: Cogito-main.zip

Could be reduced further.

@akien-mga
Copy link
Member Author

I bisected this to #87124, CC @rsubtil @godotengine/gdscript

I added some debug prints around the added simplify_path(), and indeed the reproduction project has some paths saved in scenes which are not "simple", and the mismatch seems to trigger this error.

script path before: res://addons/quick_audio/./Audio.gd
script path after: res://addons/quick_audio/Audio.gd
---
script path before: res://addons/quick_audio/Audio.gd
script path after: res://addons/quick_audio/Audio.gd
ERROR: Parser bug: Mismatched external parser.
   at: resolve_class_member (./modules/gdscript/gdscript_analyzer.cpp:909)
ERROR: Parser bug: Mismatched external parser.
   at: resolve_class_member (./modules/gdscript/gdscript_analyzer.cpp:909)
ERROR: Parser bug: Mismatched external parser.
   at: resolve_class_member (./modules/gdscript/gdscript_analyzer.cpp:909)

This seems to come from the autoload:

project.godot
25:Audio="*res://addons/quick_audio/./Audio.gd"

Removing the extra ./ from that line solves the issue in the linked project.

So that's a workaround for affected users, but the parser bug still needs to be addressed anyway.

@akien-mga akien-mga changed the title "Parser bug: Mismatched external parser" "Parser bug: Mismatched external parser" due to autoload path including unnecessary ./ Jul 8, 2024
@Glorax
Copy link

Glorax commented Jul 8, 2024

On my iMac, whenever I press the command key while the script editor is open, it immediately adds a number of "Parser bug: Mismatched external parser." errors to the output log. This also triggers when using Command + Tab.

The number of errors added to the log likely corresponds to the number of lines it takes issue with in the currently selected script.

@dalexeev
Copy link
Member

dalexeev commented Jul 9, 2024

MRP: autoload-path-mrp.zip

@Baptiste81
Copy link

It seems that it has been merged for 4.3-RC1 ?
If yes, i'm always having the problem. Cf screenshot.

image

@akien-mga
Copy link
Member Author

Do you have autoloads with a non simplified path? If not, this would be a different bug, and we'd need a reproduction project to debug further.

@zaftnotameni
Copy link

zaftnotameni commented Jul 28, 2024

Do you have autoloads with a non simplified path? If not, this would be a different bug, and we'd need a reproduction project to debug further.

what would qualify as a "non simplified path" ?

I'm also having this in 4.3rc1

ERROR: Parser bug: Mismatched external parser.
   at: (modules/gdscript/gdscript_analyzer.cpp:909)
ERROR: Parser bug: Mismatched external parser.
   at: (modules/gdscript/gdscript_analyzer.cpp:909)

@akien-mga
Copy link
Member Author

akien-mga commented Jul 28, 2024

See #94098 (comment)

You can just look in project.godot how the path to your autoloads look like.

But again, this bug was fixed, so most likely what you are both experiencing is an unrelated parser bug. It would be best that you each open an issue with a reproduction project.

@akien-mga
Copy link
Member Author

akien-mga commented Jul 28, 2024

And see #94244 for a still open known parser bug with this error message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants