You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
579 B

{-# LANGUAGE LambdaCase #-}
module Main where
import Parser.SanityCheck (sanityCheck)
import Parser.Parser (parse)
import Lexer.Lexer (runAlex')
import Simple.Convert
import Simple.TC
import System.Environment
import System.Exit
main :: IO ()
main = getArgs >>= \case
[] -> exitSuccess
f:_ -> readFile f >>= \t -> case runAlex' parse f t >>= sanityCheck f t >>= convert f t of
Right r -> runChecks r >>= \case
Right env -> print env
Left err -> putStrLn (errorStr f t err)
Left e -> putStrLn e