Commits

Anonymous committed e29b8ab

Changed the error message

  • Participants
  • Parent commits b347694

Comments (0)

Files changed (1)

File Data/Attoparsec/Internal.hs

     (<|>) = plus
 
 failDesc :: String -> Parser a
-failDesc err = Parser (\st0 kf _ks -> kf st0 [] msg)
-    where msg = "Failed reading: " ++ err
+failDesc err = Parser (\st0 kf _ks -> kf st0 [] (msg (position st0)))
+    where msg pos = "Failed reading at position " ++ show pos ++ ": " ++ err
 {-# INLINE failDesc #-}
 
 -- | Succeed only if at least @n@ bytes of input are available.