Skip to content

Syntax error from long string inside table constructor brackets #291

Description

@hugomg

LuaFormatter version 1.3.6 produces invalid output if the input program contains a [[ string inside a [ ] = table constructor.

t = { [ [[abc]] ] = 1}

When we format this, the spaces are removed and the result is a syntax error

t = {[[[abc]]] = 1}

The good news is that LuaFormatter already does the right thing for array brackets such as xs[ [[abc]] ]. Perhaps whatever logic is being used there should also be used for table constructors.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions