You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Thanks for making this work public! I'm interested in using this project to get the AST of python code represented in OCaml, modify the AST, and write the AST back as python code.
Is there a way to convert the AST represented as OCaml value to be converted into python AST - so I can use ast.unparse() to write the python source code?
If the above method is too tedious, is the only other option to write a printer for the AST in OCaml that spits out python code? This creates potential mismatch with python ast module
The text was updated successfully, but these errors were encountered:
Unfortunately I did not include any logic to re-convert the OCaml values back into the Python layer. In theory this can be done, but it's going to require as much code as I have for the parser. I do not have plan to take on such workload any time soon, as the initial intended purpose of this project is a uni-directional conversion from Python AST to OCaml and not the other way around.
And you are correct that it's also possible to serialize the OCaml AST from OCaml directly, with the caveat that the output may not fully match ast.unparse().
Hi, Thanks for making this work public! I'm interested in using this project to get the AST of python code represented in OCaml, modify the AST, and write the AST back as python code.
The text was updated successfully, but these errors were encountered: