2024-10-05 13:31:09 -07:00
|
|
|
module Main where
|
|
|
|
|
|
2024-12-01 18:06:03 -08:00
|
|
|
import qualified Data.Map.Strict as M
|
2024-11-30 23:43:17 -08:00
|
|
|
import Program (handleAndParseFile)
|
2024-11-15 18:39:44 -08:00
|
|
|
import Repl
|
2024-11-11 14:34:55 -08:00
|
|
|
|
2024-10-05 13:31:09 -07:00
|
|
|
main :: IO ()
|
2024-10-05 16:04:13 -07:00
|
|
|
main = do
|
2024-11-15 18:39:44 -08:00
|
|
|
args <- getArgs
|
|
|
|
|
case args of
|
2024-11-17 18:33:14 -08:00
|
|
|
[] -> void repl
|
2024-11-30 23:43:17 -08:00
|
|
|
files -> handleFiles files
|
2024-11-15 18:39:44 -08:00
|
|
|
|
2024-11-30 23:43:17 -08:00
|
|
|
handleFiles :: [String] -> IO ()
|
|
|
|
|
handleFiles [] = putTextLn "success!"
|
2024-12-01 18:06:03 -08:00
|
|
|
handleFiles (file : rest) = runExceptT (handleAndParseFile M.empty file) >>= either putStrLn (const $ handleFiles rest)
|