-
Notifications
You must be signed in to change notification settings - Fork 31
fix RIDER-130140 GDScript: parsing fixes #406
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a parsing issue where inline lambda functions as constructor arguments were causing errors when parsing subsequent arguments in GDScript.
- Improved argument list parsing to properly handle whitespace and newlines after commas
- Added a dedicated method for skipping whitespace within argument lists
- Added test coverage for the callable constructor scenario
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
callableInCtor.gd | Test case demonstrating inline lambda in constructor call |
callableInCtor.txt | Expected parse tree output for the test case |
GdGodotTest.kt | Added test method for the callable constructor scenario |
GdArgListParser.kt | Fixed whitespace handling in argument lists to resolve parsing errors |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
b2987b0
to
87b32b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
gdscript/src/main/kotlin/gdscript/parser/common/GdArgListParser.kt
Outdated
Show resolved
Hide resolved
gdscript/src/main/kotlin/gdscript/parser/common/GdArgListParser.kt
Outdated
Show resolved
Hide resolved
…ing errors in later args
87b32b7
to
4c4ee55
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This seems to fix broken lambda parsing in my project! Haven't checked every single lambda yet (still lots of red in my project) but it's a big improvement. |
I did find another lambda parsing issue, filed RIDER-131046 |
likely need to change gd.frlex
|
I am investigating an issue with the following codes.
It seems that parser remaps DEDENT-s inside
func():
too agressively thus in GdStmtParser#suite we exit on the second lineif (!b.nextTokenIs(NEW_LINE))
.and