Make Morley ASTs extendable with arbitrary info
Clarification and motivation
In morley
we have different ASTs: Michelson.Typed.Instr.Instr inp out
, Michelson.Untyped.Instr.InstrAbstract op
, Michelson.Untyped.Instr.ExpandedOp
.
Some of them store source locations, some of them don't. However, having source location as a part of AST (WithSrcEx
wrapper) is not the best idea, as we can't be sure whether locations are present or not, for example.
One possible idea would be to use Trees-That-Grow technique, as used in GHC, to be able to extend ASTs with arbitrary info.
Acceptance criteria
Approaches are evaluated and the selected one is implemented. It should be possible to store arbitrary info like source locations in ASTs and write functions demanding that this info is present.