Skip to content

Wrong intent when calling to_lua_source() #24

@penguinol

Description

@penguinol

for example, a lua file like:

local a = 0
if a == 0 then
    if a == 1 then
        if a == 2 then
            if a == 3 then

            end
        end
    end
end

I loaded the lua source by ast, and then rewrite the ast to source.

lua_ast = ast.parse(content)
tree = ast.parse(content)
print(ast.to_lua_source(tree))

the output is like

local a = 0
if a == 0 then
  if a == 1 then
      if a == 2 then
            if a == 3 then

            else

            end
      else

      end
  else

  end
else

end

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