Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (22 sloc) 0.8 kb
import FLNV.Expression
import FLNV.Parser
import FLNV.AST
import FLNV.Error
import System.IO
import System.Exit
runParser :: String -> IO Expression
runParser str = case (readExpr str :: Either Error Expression) of
Right expr -> return expr
Left err -> do putStrLn (show err)
exitWith $ ExitFailure 1
doDesugar :: Expression -> IO AST
doDesugar exp = do case (runDesugar $ desugar exp) of
(Left err) -> do putStrLn (show err)
exitWith $ ExitFailure 2
(Right ast) -> return ast
main :: IO ()
main = do prog <- getContents
expr <- runParser prog
ast <- doDesugar expr
putStrLn $ show ast
exitWith ExitSuccess
Jump to Line
Something went wrong with that request. Please try again.