gkz / grasp

JavaScript structural search, replace, and refactor
http://graspjs.com
MIT License
1.28k stars 33 forks source link

Grasp is missing ability to work as AST->AST transformer #34

Open RReverser opened 10 years ago

RReverser commented 10 years ago

A lot of tools exist today for working with AST, and it's important to them to be able to communicate with each other by just passing AST as input, transforming it inside and outputting AST object as well.

Grasp seems to use Mozilla AST internally, and it's possible to pass AST in using identity function (function (input) { return input }) in parser option, but it lacks ability to get resulting AST after replacement.

Such feature should be easy to add (I'm just not familiar with LiveScript syntax, so it may take more time to figure out how to do that) and it will allow much better interoperability with other developer tools.