-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Allow newlines after match
condition commas without requiring backslashes at end of each line
#2201
Comments
match
condition commas
I think you can add a backslash before each line break in the comma expression. |
Tested and confirmed. I think the request is valid, but much less pressing. It becomes a discoverability issue more than a legibility issue. Do you want me to rewrite the issue? |
No, I think it's fine as-is 🙂 I edited the title accordingly. |
match
condition commasmatch
condition commas without requiring backslashes at end of each line
Describe the project you are working on
I want the following statement to be more legible
Describe the problem or limitation you are having in your project
It is difficult to read each of the possible match conditions when they are forced to be on the same line.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
GDScript should allow a newline after the comma in a
match
case with multiple conditions. Compare the above example this this one:Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If the
match
condition has a comma followed by a newline, the parser should process the next line as another condition of the same case (expecting the indent to be the same).If this enhancement will not be used often, can it be worked around with a few lines of script?
The legibility cannot be worked around.A blackslash after each comma will allow the parser to treat them as if they are on the same line, but this may not be obvious to or expected by all developers
Is there a reason why this should be core and not an add-on in the asset library?
Not applicable. This is a language parsing issue.
The text was updated successfully, but these errors were encountered: