PiotrDabkowski / pyjsparser

Fast JavaScript parser for Python.
MIT License
246 stars 37 forks source link

Reverse parsing #9

Closed monami7000 closed 5 years ago

monami7000 commented 7 years ago

How can we reverse the parsed code (the obtained dictionary) to get the initial one?

shamoons commented 5 years ago

Any update on this?

PiotrDabkowski commented 5 years ago

It is not possible directly and out of scope for this project. However you can do that with Js2Py. See the test_runner.py for an example. It uses escodegen.js library (converts ast to code) translated to python via Js2Py.