Hello everyone,
I'm currently writing a parser using megaparsec which produces the following output:
data FileElement
= SyntaxStmt SyntaxStatement
| PackageSpec PackageSpecification
| ImportStmt ImportStatement
| OptionDef OptionDefinition
| MsgDef MessageDefinition
| EnumDef EnumDefinition
| ServiceDef ServiceDefinition
deriving (Show, Eq)
type File = [FileElement]
it goes on with more nested substructures.
Now I realized that I need to record the location in the document for every entity.
What would be the best way of integrating this into the AST? I would like to avoid changing the AST itself, but have the location information
