Closed TheMatten closed 1 year ago
posLineCols fails with
posLineCols
*** Exception: FlatParse.Basic.posLineCols: invalid position
on any input with more than one Pos - problem seems to be with initial sorting assuming increasing, not decreasing values of Pos: https://github.com/AndrasKovacs/flatparse/blob/702a2093d8d5171a9faee495cb0ff43878a37b5a/src/FlatParse/Basic.hs#L407
Pos
Instead, it should probably sort the opposite way, e.g. with Down:
Down
sorted = sortOn (Down . snd) (zip [0..] poss)
and such modified function seems to work fine on some test inputs.
Fixed by ba96008d900935ab118710eb7ee89dffff9949c9. I also updated on Hackage.
posLineCols
fails withon any input with more than one
Pos
- problem seems to be with initial sorting assuming increasing, not decreasing values ofPos
: https://github.com/AndrasKovacs/flatparse/blob/702a2093d8d5171a9faee495cb0ff43878a37b5a/src/FlatParse/Basic.hs#L407Instead, it should probably sort the opposite way, e.g. with
Down
:and such modified function seems to work fine on some test inputs.