StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

Formation with comment between colon and method - breaks AST

Open d-enk opened this issue 5 months ago • 0 comments

before:

build(): -- comment
init():start()

after:

build()(): -- commentinit():start()

--verify

error: could not format file ./stylua.lua: INTERNAL ERROR: Output AST generated a syntax error. Please report this at https://github.com/johnnymorganz/stylua/issues
error occurred while creating ast: unexpected token ``. (starting from line 8, character 1 and ending on line 8, character 1)
additional information: expected method

With . instead : - OK

build(). -- comment
init():start()
build()
	-- comment
	.init()
	:start()

Looks like related #873

d-enk avatar Sep 11 '24 17:09 d-enk