logoalt Hacker News

philipallstaryesterday at 11:37 AM1 replyview on HN

You might need a bit more than ASTs, as you need code to be human-readable as well as machine-readable. Maybe CSTs?


Replies

rs545837yesterday at 4:26 PM

CSTs are the right call for round-tripping, but isn't that essentially what tree-sitter gives you, a concrete syntax tree that preserves whitespace, comments, and formatting.