How to retrieve comments using Megaparsec?

123 views Asked by At

I'm printing an AST in order to format the source file, from which the AST is generated using Megaparsec. Comments are missing from the AST, but I intend to keep them after reformatting. Is there a way in Megaparsec to obtain all comments (for both line and block comments) annotated with source info, either inside AST as a node or outside separately as done in Language.Haskell.Exts.Annotated?

0

There are 0 answers