egison / egison/egison-pattern-src
attach locations to AST with attachSourcePosSource
- Dominant language
- Haskell
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
We currently use [`getSourcePos`](https://hackage.haskell.org/package/megaparsec-8.0.0/docs/Text-Megaparsec.html#v: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`](https://hackage.haskell.org/package/megaparsec-8.0.0/docs/Text-Megaparsec.html#v:getOffset) to annotate with offsets first and convert them to `SourcePos` later with [`attachSourcePosSource`](https://hackage.haskell.org/package/megaparsec-8.0.0/docs/Text-Megaparsec-Error.html#v:attachSourcePos) would be faster.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.