Fixed bug in withRaw.
Didn't correctly handle case where nothing is parsed.
This commit is contained in:
parent
6e36375bdc
commit
2695434113
1 changed files with 1 additions and 1 deletions
|
@ -412,7 +412,7 @@ withRaw parser = do
|
|||
let (l2,c2) = (sourceLine pos2, sourceColumn pos2)
|
||||
let inplines = take ((l2 - l1) + 1) $ lines inp
|
||||
let raw = case inplines of
|
||||
[] -> error "raw: inplines is null" -- shouldn't happen
|
||||
[] -> ""
|
||||
[l] -> take (c2 - c1) l
|
||||
ls -> unlines (init ls) ++ take (c2 - 1) (last ls)
|
||||
return (result, raw)
|
||||
|
|
Loading…
Add table
Reference in a new issue