Is it possible to turn the AST back into CoffeeScript instead of into JavaScript? A project I am working basically requires turning all the CoffeeScript into the AST, analysing the AST, then turning portions of the AST back into CoffeeScript. I understand the transformation back would be ‘lossy’ with regards to the original code, but this is okay.
I would really like to avoid having to compile those portions to JavaScript and then back to CoffeeScript.
See round_trip.coffee in CoffeeCoffee project (I’m the author):
I don’t cover every case, but it’s a start.