Commit dee18f82 authored by Paul Ogris's avatar Paul Ogris
Browse files

Pretty error output

parent 8d3dfef1
......@@ -12,10 +12,9 @@ import Relax
import Options.Generic
import qualified Data.Text.IO as T
data CLI = CLI
{
input :: FilePath <?> "Input file"
} deriving (Show, Generic)
newtype CLI = CLI
{ input :: FilePath <?> "Input file" }
deriving (Show, Generic)
instance ParseRecord CLI
......@@ -25,5 +24,5 @@ main = do
inp <- T.readFile (unHelpful $ input cli)
case parse program (unHelpful $ input cli) inp of
Left e -> error (show e)
Left e -> error (errorBundlePretty e)
Right x -> T.putStrLn $ prettyProgram (relax x)
......@@ -11,6 +11,7 @@ module Language.LARS
-- * Pretty Printing
prettyOneLine,
prettyProgram,
errorBundlePretty,
-- * Parsing
parse,
......
a(X) :- b(X), not c(X).
b(1). b(2).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment