boolangery / py-lua-parser

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

Fix two issues with ast.to_lua_source() #45

Closed quarantin closed 1 year ago

quarantin commented 1 year ago

This pull request is fixing two issues I've been encountering while using ast.to_lua_source() and for which you have issues opened: 1) When parsing a return statement that doesn't return a value, the resulting code will be: return False instead of return #44 2) When parsing a local assignment without a value, the resulting code will be: local some_var = instead of local some_var #37

I'm not sure if my patch is the good way to do it, but at least I tested it and it's working as expected. Please let me know if I should change anything to get my pull-request accepted.