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

Make inline blocks in GDScript more (or less) pythonic #8123

Merged

Conversation

bojidar-bg
Copy link
Contributor

Fixes #8001

From #8001 (comment) on it: (Quoting just in case)

So, testing with python3, the following are allowed:

if 1: print(1)
if 1:
  print(1)
for i in (0,1,2): print(1)

While the following are not:

if 1: print(1)
  print(2)
for i in (0,1,2): if 1: print(1)
for i in (0,1,2): if 1:
  print(1)

Currently, in GDScript, all of the first group are allowed, in addition to:

if 1: print(1)
  print(2)
for i in [0,1,2]: if 1: print(1)

With this PR, GDScript now supports the following:

for i in (0,1,2): if 1:
  print(1)
for i in (0,1,2): if 1: print(1)

But, it also drop the support for the following:

if 1: print(1)
  print(2)

@akien-mga akien-mga merged commit 495710c into godotengine:master Mar 24, 2017
@bojidar-bg bojidar-bg deleted the gdscript-inline-block-indent branch March 30, 2017 10:40
@bojidar-bg bojidar-bg restored the gdscript-inline-block-indent branch April 8, 2017 16:00
bojidar-bg added a commit to bojidar-bg/godot that referenced this pull request Apr 8, 2017
Should close godotengine#8315
Please test, I'm still unsure I did it correctly...
akien-mga added a commit that referenced this pull request Apr 9, 2017
groscalin pushed a commit to groscalin/godot that referenced this pull request Jul 15, 2017
Should close godotengine#8315
Please test, I'm still unsure I did it correctly...
@aaronfranke aaronfranke added this to the 3.0 milestone Jan 26, 2020
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.

GDScript, indentation and inline blocks not working well together
3 participants