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

Fix multiline array/dictionary match statements #90373

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

bitwise-aiden
Copy link
Contributor

Currently array and dictionary expressions cannot be spread over multiple lines in match statements.

Adding mutliline push/pop while parsing the pattern for bracket and brace enables the ability for these to be multiline. This enables more complex patterns to be matched without exceeding line limits.

Fixes #90372

@bitwise-aiden bitwise-aiden requested a review from a team as a code owner April 8, 2024 02:17
@dalexeev dalexeev added this to the 4.3 milestone Apr 8, 2024
@dalexeev
Copy link
Member

dalexeev commented Apr 8, 2024

Thank you for the PR! Please add test cases for this.

@akien-mga akien-mga changed the title Fixes multiline array/dictionary match statements Fix multiline array/dictionary match statements Apr 8, 2024
@bitwise-aiden bitwise-aiden force-pushed the ba-fix-mutliline-match branch from 580e3d9 to 847d708 Compare April 8, 2024 14:31
@bitwise-aiden bitwise-aiden force-pushed the ba-fix-mutliline-match branch from 847d708 to 85d5feb Compare April 8, 2024 14:33
@bitwise-aiden
Copy link
Contributor Author

Thank you for the PR! Please add test cases for this.

I believe this is good to go, let me know if there is anything else you're after.

modules/gdscript/gdscript_parser.cpp Outdated Show resolved Hide resolved
modules/gdscript/gdscript_parser.cpp Outdated Show resolved Hide resolved
@dalexeev
Copy link
Member

Please squash commits into one. To do this you need a local git client, GitHub web interface doesn't support it.

@bitwise-aiden bitwise-aiden force-pushed the ba-fix-mutliline-match branch from 35ab7b7 to f989f79 Compare April 10, 2024 14:31
@bitwise-aiden bitwise-aiden force-pushed the ba-fix-mutliline-match branch from f989f79 to 0b05e5b Compare April 10, 2024 14:36
@akien-mga akien-mga force-pushed the ba-fix-mutliline-match branch from 0b05e5b to 1aee33a Compare April 12, 2024 08:59
Currently array and dictionary expressions cannot be spread over
multiple lines in match statements.

Adding mutliline push/pop while parsing the pattern for bracket and
brace enables the ability for these to be multiline. This enables more
complex patterns to be matched without exceeding line limits.

Fixes godotengine#90372
@akien-mga akien-mga force-pushed the ba-fix-mutliline-match branch from 1aee33a to 74177d7 Compare April 12, 2024 08:59
@akien-mga akien-mga merged commit da0e993 into godotengine:master Apr 12, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

Match statement doesn't support multiline array/dictionary expressions
4 participants