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

Improve misleading Unexpected "x" in class body. GDScript parser error #99887

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

JackErb
Copy link
Contributor

@JackErb JackErb commented Nov 30, 2024

This parser error was misleading.

Fixes:

  1. Now points at correct line
  2. Now prints out the raw token source for identifiers (e.g. "variable_name" instead of "Identifier")

====

With Change:

image

Without Change (misleading):

image

@JackErb JackErb requested a review from a team as a code owner November 30, 2024 22:39
@JackErb JackErb changed the title Improve GDScript "unexpected token in class body" parser error Improve misleading GDScript parser error Nov 30, 2024
@JackErb JackErb force-pushed the gdscript-parser-error-fix branch from 1b8b688 to 52110ab Compare December 1, 2024 05:50
@JackErb JackErb requested a review from a team as a code owner December 1, 2024 05:50
@dalexeev dalexeev added this to the 4.4 milestone Dec 1, 2024
@dalexeev
Copy link
Member

dalexeev commented Dec 1, 2024

@JackErb JackErb force-pushed the gdscript-parser-error-fix branch from 52110ab to b04497c Compare December 1, 2024 09:14
@JackErb
Copy link
Contributor Author

JackErb commented Dec 1, 2024

Probably fixes (need testing):

Verified it fixes #96792

@JackErb JackErb requested a review from dalexeev December 1, 2024 09:41
@adamscott adamscott changed the title Improve misleading GDScript parser error Improve misleading Unexpected "x" in class body. GDScript parser error Dec 6, 2024
@JackErb JackErb force-pushed the gdscript-parser-error-fix branch from b04497c to 04a2573 Compare December 6, 2024 21:10
@JackErb JackErb requested a review from dalexeev December 6, 2024 21:12
@JackErb JackErb force-pushed the gdscript-parser-error-fix branch from 04a2573 to 20d46c6 Compare December 6, 2024 21:15
This parser error was misleading.

Fixes:
1. Now points at correct line
2. For identifiers, prints out `Identifier "%s"`
@JackErb JackErb force-pushed the gdscript-parser-error-fix branch from 20d46c6 to 13fcb05 Compare December 10, 2024 05:01
@JackErb JackErb requested a review from dalexeev December 10, 2024 05:02
Copy link
Member

@dalexeev dalexeev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@Repiteo Repiteo merged commit 79dd517 into godotengine:master Dec 10, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 10, 2024

Thanks! Congratulations on your first merged contribution! 🎉

@JackErb JackErb deleted the gdscript-parser-error-fix branch December 10, 2024 20:55
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.

Error "Unexpected Identfier in class body" shows wrong line
3 participants