Skip to content

Rendering Some Lua Tables False #26

@Asterata

Description

@Asterata

Example code:

local Table = {"a", "b", "c"};

I have used ast.to_lua_source for turning the ast into a lua code
The output i got:

local Table = {
    1 = "a",
    2 = "b",
    3 = "c",
}
;

What it should be:

local Table = {
    [1] = "a",
    [2] = "b",
    [3] = "c",
}
;

Used python code:

from luaparser import ast

src = """
local Table = {"a", "b", "c"};
"""

tree = ast.parse(src)
print(ast.to_lua_source(tree))

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