logic/Main.hs

16 lines
343 B
Haskell

module Main where
import Logic.Parse (eof, mkInput, ParseError(..))
import Logic.Statement (stmt)
main :: IO ()
main = do
line <- getLine
either fail print $ eof stmt $ mkInput line
where
fail err@(ParseError pos message) =
putStrLn $
"parse error at position "
<> show pos
<> ": "
<> message