diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2018-03-26 21:34:51 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2018-03-26 21:34:51 +0200 |
commit | 0e1f435314b382cb78056f04d0997df43e4f8fcf (patch) | |
tree | 8195b40c448cbbafc868a9727b6e1c218f26ca00 /Main.hs | |
parent | c25979b76c1dd22b6dc33acb994e9044c56a68f9 (diff) |
Rename files for case-sensitive file system
Diffstat (limited to 'Main.hs')
-rw-r--r-- | Main.hs | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -0,0 +1,29 @@ +module Main where + +import System.Environment +import System.Exit + +import Compiler +import Optimiser +import Parser +import VM + + +usage :: IO () +usage = do + progname <- getProgName + putStrLn $ "Usage: " ++ progname ++ " [filename.lisp]" + +main :: IO () +main = do + clargs <- getArgs + source <- case clargs of + [] -> getContents + [fname] -> readFile fname + _ -> usage >> exitFailure + + prog <- parseProgram source >>= either (die . show) return + irprog <- either die return (compileProgram prog) + let opt = optimise irprog + -- print opt + vmRun opt |