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

GDScript: Support multiline indexing with [] #54227

Merged

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Oct 25, 2021

Fixes #35417.

This is the fix that was suggested by @bojidar-bg in #35417, and which was used recently on @vnen's advice for preload(): #52521.

Tested with:

func foo(p):
	return p[
		1 +
		3
		-2
	]

func _ready():
	print(foo([0, 1, 2, 3])) # 2

@akien-mga akien-mga added this to the 3.5 milestone Oct 25, 2021
@akien-mga akien-mga requested a review from a team as a code owner October 25, 2021 13:53
Copy link
Member

@vnen vnen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akien-mga akien-mga merged commit bd828c4 into godotengine:3.x Nov 8, 2021
@akien-mga akien-mga deleted the 3.x-gdscript-multiline-indexing branch November 8, 2021 14:03
@akien-mga
Copy link
Member Author

Cherry-picked for 3.4.1.

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.

2 participants