Reputation: 1301
I'm aware that its fairly trivial to pretty print code with a CST, since information about the grammar is stored in the node.
However, when converted to a AST, much of the initial structure of the source code is lost from de sugaring and other transformations. Thus how can a AST pretty print source code given that it has undergone these major translations? Does it contain references to the AST that was used to generate it (and therefore the grammar/structure necessary to perfectly reproduce the source code)?
Upvotes: 0
Views: 211