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.

22 lines
579 B

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