benjamn / recast

JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
MIT License
4.91k stars 347 forks source link

Support for CST input #1412

Open KernelDeimos opened 3 weeks ago

KernelDeimos commented 3 weeks ago

When I found out someone is working on a format-preserving printer for @babel/generate, I also saw in a comment that @babel/parser has a tokens parameter that outputs a CST. Well, kind of; it outputs the AST and then dumps the lexer output as well, so it seems. I haven't yet found a "real" CST-outputting parser for javascript (well, I found this repo but it looks dead). recast supporting babel's output with tokens: true would make it possible to fix issues like this one

conartist6 commented 2 weeks ago

@KernelDeimos hi, it sounds like you're looking for my project, BABLR!