on master help sign in
Convert trifecta's pretty-printed error messages in Pkg

Because Pkg is entirely outside the mechanism that control the output in other parts of Idris, the easiest solution is to scrub the error messages from trifecta, which will otherwise contain ANSI escapes or not on different systems.

commit78c00517cca93e9852b821038356ce0ec52e49bd authorNiklas Larsson <niklas@mm.st> dateTue 26 Jan 2016, 00:07 (11 years ago) parent06453bc
1 file changed+2−2
src/Pkg/PParser.hs+2−2
src/Pkg/PParser.hs+2−2
@@ -5,7 +5,7 @@
55module Pkg.PParser where
66
77import Text.Trifecta hiding (span, charLiteral, natural, symbol, char, string, whiteSpace)
8−
8+import qualified Text.PrettyPrint.ANSI.Leijen as PP
99import Idris.Core.TT
1010import Idris.REPL
1111import Idris.AbsSyntaxTree
@@ -51,7 +51,7 @@ parseDesc :: FilePath -> IO PkgDesc
5151parseDesc fp = do
5252 p <- readFile fp
5353 case runparser pPkg defaultPkg fp p of
54− Failure err -> fail (show err)
54+ Failure err -> fail (show $ PP.plain err)
5555 Success x -> return x
5656
5757pPkg :: PParser PkgDesc