Rene Saarsoo
Rene Saarsoo
That's an intriguing idea, but I to my understanding Babel does not fully preserve the original whitespace. For example, when transforming the following code, that has nothing to transform: ```...
On further investigation I discovered that it might be feasible to use the parser of Babel - Babylon. The AST it generates is mostly compatible with ESTree format used by...
@benjamn Yep, Lebab is already using that run Espree parser instead. The problem with Babylon is that it doesn't produce AST that's fully compatible with ESTree spec.
I actually started out with switching the parser in Lebab over to Babylon. Wrote an adapter to convert Babylon node types to Esprima node types, this got most of the...
I wonder how well does something like this babylon-to-espree work? Like what are the downsides of not using Babylon AST directly? For Lebab the speed isn't really a crucial aspect....
Rewriting Lebab transforms as Babel transforms is another direction I'd really like to explore. But that will be a larger undertaking. I've accumulated a fair chunk of code in all...
I do still have very much interest in doing this. Though I have drawn myself back from various open-source developments lately to just spend more time in the real world....
Hard to point out any general resources. If you have a specific question in mind, feel free to ask.
The approach I originally tried regarding this whole thing was to replace just the parser used by Lebab with Babel. It didn't really turn out quite as simple though, but...
Thanks @jonluca! Changed the link in README to point at lebabjs.com. Don't know what has happened with the old link. It used to be just a GitHub page, but looks...