split Logic.Statement into files, simpler serialization
This commit is contained in:
parent
0fa510e31a
commit
d781334419
5 changed files with 276 additions and 217 deletions
9
Main.hs
9
Main.hs
|
@ -1,12 +1,17 @@
|
|||
module Main where
|
||||
|
||||
import Logic.Parse (eof, mkInput, ParseError(..))
|
||||
import Logic.Statement (stmt)
|
||||
import Logic.Statement.Parse (stmt)
|
||||
import Logic.Statement.Serialize (serializeLatexTruthTable)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
line <- getLine
|
||||
either fail print $ eof stmt $ mkInput line
|
||||
case eof stmt $ mkInput line of
|
||||
Left err -> fail err
|
||||
Right statement -> do
|
||||
putStrLn $ show statement
|
||||
putStr $ serializeLatexTruthTable statement
|
||||
where
|
||||
fail err@(ParseError pos message) =
|
||||
putStrLn $
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue