Conversation

Has there been work on deriving code formatters from parsers, esp. parser combinators? E.g. of taking a parser that generates an AST, and deriving one that generates an AST annotated with the comments from the source file, so that they can be preserved for formatting.
5
27
I think Makam has a bidirectional parser/pretty printer? I don't think it uses it for a code formatter though, and I don't think it preserves comments etc. It had a link to a paper in the source IIRC.
1
1