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.
We currently use
getSourcePosto obtain current source location during parsing and annotate AST with it, but as the documentation says,getSourcePosis slow to use frequently. UsinggetOffsetto annotate with offsets first and convert them toSourcePoslater withattachSourcePosSourcewould be faster.