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

Comma-first (return) explists with comments are broken #662

Closed
appgurueu opened this issue Mar 29, 2023 · 3 comments · Fixed by #663
Closed

Comma-first (return) explists with comments are broken #662

appgurueu opened this issue Mar 29, 2023 · 3 comments · Fixed by #663
Labels
bug Something isn't working

Comments

@appgurueu
Copy link

appgurueu commented Mar 29, 2023

Run the following through StyLua (version 0.14.3):

function f()
	return a -- adoc
		, b -- bdoc
end

result:

function f()
	return a -- adoc,
		b -- bdoc
end

This is a syntax error.

The comma is correctly (consistent with paramlists) moved to a, but instead of being moved to right after a, it is moved to after the comment.

Related: #307. This is essentially the same issue but for (retstat?) explists.

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Mar 29, 2023
@JohnnyMorganz
Copy link
Owner

JohnnyMorganz commented Mar 30, 2023

Also an issue in a local assignment

local a -- adoc
, b -- bdoc
= 1, 2

or

local a
, b
= 1 -- adoc
, 2 -- bdoc

@JohnnyMorganz
Copy link
Owner

This has been fixed and is available in v0.17.1

@appgurueu
Copy link
Author

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants