-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Parse error in multiline subscription expression #35417
Comments
Adding godot/modules/gdscript/gdscript_parser.cpp Lines 1251 to 1253 in 1c6d1fc
Note that the following code would continue erroring, but it should be resolved with #35415: var x = (z
[p]) |
I don't think that should be changed. The language is just designed after Python in that regard: to require parentheses for allowing line breaks in expressions). (See #208 (comment) for context.) |
@RandomShaper godot/modules/gdscript/gdscript_parser.cpp Lines 946 to 988 in a61f5a7
|
I think that's for the context when an array is declared, to allow one item per line:
What is happening in the example code is indexing, which is parsed here: godot/modules/gdscript/gdscript_parser.cpp Line 1245 in a61f5a7
|
So it makes sense that the following two are:
|
I wasn't too convinced about your point since I thought the rule was intended for actual parentheses, rather than expression "enclosing". I was wrong. Moreover, regardless any other consideration, since Python allows it and the intent is that GDScript imitates its syntax, it should be allowed. |
This issue doesn't seem to be there in master branch. |
Fixes godotengine#35417. (cherry picked from commit 92664f0)
Fixed by #54227. |
Godot version:
master @ d11d7df
OS/device including version:
Linux
Issue description:
Godot raises parse error on the code below:
The text was updated successfully, but these errors were encountered: