py-lua-parser icon indicating copy to clipboard operation
py-lua-parser copied to clipboard

Rendering Some Lua Tables False

Open Asterata opened this issue 2 years ago • 1 comments

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))

Asterata avatar Jul 23 '22 12:07 Asterata

The same problem

MikeMihailov avatar Aug 11 '22 12:08 MikeMihailov