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
I would like to perform some changes in all the CoffeeScript files that are defined in a couple of repos that I have. I saw that by using coffeescript I can get a hold of the AST by doing the following
The problem with this approach is that there is no way to write the modified AST back to a coffee file. I got a suggestion of compiling the AST(coffeescript) to javascript, and then use js2coffee to write the result back to a coffeescript file. Is there a way to pass the modified AST(coffeescript) to js2coffee to generate a coffeescript file?
The text was updated successfully, but these errors were encountered:
In between these two lines, you can manipulate the nodes however you want.
EDIT: Just noticed you’re trying to get to CoffeeScript in the end. Sorry, not sure how to get there. The above will at least let you make your own version of the CoffeeScript compiler that includes your AST manipulations, then as you said you could pass that generated JS through js2coffee.
Hey folks,
I would like to perform some changes in all the CoffeeScript files that are defined in a couple of repos that I have. I saw that by using
coffeescript
I can get a hold of the AST by doing the followingThe problem with this approach is that there is no way to write the modified AST back to a coffee file. I got a suggestion of compiling the AST(coffeescript) to javascript, and then use
js2coffee
to write the result back to a coffeescript file. Is there a way to pass the modified AST(coffeescript) tojs2coffee
to generate a coffeescript file?The text was updated successfully, but these errors were encountered: