16 lines
403 B
Haskell
16 lines
403 B
Haskell
module Main where
|
|
|
|
import Eval (Env, emptyEnv)
|
|
import Parser (handleFile)
|
|
import Repl
|
|
|
|
main :: IO ()
|
|
main = do
|
|
args <- getArgs
|
|
case args of
|
|
[] -> void repl
|
|
files -> handleFiles emptyEnv files
|
|
|
|
handleFiles :: Env -> [String] -> IO ()
|
|
handleFiles _ [] = putTextLn "success!"
|
|
handleFiles env (file : rest) = runExceptT (handleFile env file) >>= either putStrLn (`handleFiles` rest)
|