Skip to content

Lua 5.2 label syntax error when using binary built all features enabled #407

@Feez

Description

@Feez

I was experimenting with using StyLua on minified Lua, and found that StyLua fails to parse this valid Lua when minified.

source:

local function test()
    goto end_thing

    local x = 1

    ::end_thing::
end

-> minified:

local function a()goto b;local c=1::b::end

with error:

error: could not format file minified.lua: error parsing: unexpected token `end`. (starting from line 1, character 40 
and ending on line 1, character 43)
additional information: expected identifier after `::`

If I add a semicolon after local c = 1 in the minified Lua then it parses as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalThis issue relies on an external factor

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions