egison / egison-pattern-src

Manipulating Egison patterns: abstract syntax, parser, and pretty-printer
https://hackage.haskell.org/package/egison-pattern-src
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

attach locations to AST with attachSourcePosSource #5

Open coord-e opened 4 years ago

coord-e commented 4 years ago

We currently use getSourcePos to obtain current source location during parsing and annotate AST with it, but as the documentation says, getSourcePos is slow to use frequently. Using getOffset to annotate with offsets first and convert them to SourcePos later with attachSourcePosSource would be faster.