boolangery / py-lua-parser

A Lua parser and AST builder written in Python.
MIT License
115 stars 36 forks source link

Brackets are absent in output of AST->source_code conversion #57

Open Real-Gecko opened 3 months ago

Real-Gecko commented 3 months ago

Code:

from luaparser import ast

source = """
result = (a + b) / (c + d)
"""

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

Output:

result = a + b / c + d