-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Add/Modify CoffeeScript AST and write result to coffescript file #4556
Comments
As in, generate CoffeeScript code from a set of AST nodes? Not using just the CoffeeScript module itself. The The https://github.com/js2coffee/js2coffee module takes JavaScript and converts it into CoffeeScript, so I guess you could use |
@GeoffreyBooth Thanks! I'll give it a try |
Somewhat related is that CoffeeScriptRedux was very ambitious and included a CoffeeScript code generator; see https://github.com/michaelficarra/cscodegen |
@lydell I'll ask them, thanks! |
# Parse a string of CoffeeScript code or an array of lexed tokens, and
# return the AST. You can then compile it by calling `.compile()` on the root,
# or traverse it by using `.traverseChildren()` with a callback.
Edit: Whoops -- read too fast.
Nope, my bad. |
@jashkenas np 👍 |
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 I can get a hold of the AST by doing the following
Is there a way to write the AST back to a coffescript file?
The text was updated successfully, but these errors were encountered: