mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
; imp: use megaparsec's prettyprinter for assertion parse errors
This commit is contained in:
parent
4b1919de02
commit
72e94f4d80
@ -420,7 +420,7 @@ args = info (helper <*> parser) $ mconcat
|
||||
parsed <- P.runParserT (runStateT p H.nulljournal) "" s
|
||||
case parsed of
|
||||
Right (a, _) -> pure (s, a)
|
||||
Left err -> fail ("failed to parse input '" ++ unpack s ++ "': " ++ show err)
|
||||
Left err -> fail ("failed to parse input '" ++ unpack s ++ "': " ++ P.errorBundlePretty err)
|
||||
|
||||
readParsec' :: H.SimpleTextParser a -> ReadM (String, a)
|
||||
readParsec' p = do
|
||||
@ -428,7 +428,7 @@ args = info (helper <*> parser) $ mconcat
|
||||
let parsed = runIdentity $ P.runParserT p "" (pack s)
|
||||
case parsed of
|
||||
Right a -> pure (s, a)
|
||||
Left err -> fail ("failed to parse input '" ++ s ++ "': " ++ show err)
|
||||
Left err -> fail ("failed to parse input '" ++ s ++ "': " ++ P.errorBundlePretty err)
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user