maxtaco / coffee-script

IcedCoffeeScript
http://maxtaco.github.com/coffee-script
MIT License
727 stars 58 forks source link

Add noIcedTransform option to CoffeeScript.nodes() #159

Closed paigeruten closed 9 years ago

paigeruten commented 9 years ago

Hi, I have been trying to do some Iced CoffeeScript code instrumentation by manipulating the transformed AST returned by CoffeeScript.nodes(), and have realized it would be much better to instrument the AST before the iced transformation. There's currently no way to do this, so this change adds a noIcedTransform option to CoffeeScript.nodes(), which lets you write code like this:

ast = iced.nodes(code, noIcedTransform: true)
# ...manipulate ast...
ast = ast.icedTransform()
js = ast.compile()
maxtaco commented 9 years ago

Live in v108.0.7 (that's CS 1.8.0 with our 7th patch, had to change the numbering system to satisfy npm).