aboutsummaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-08-20 14:47:15 +0200
committertomsmeding <tom.smeding@gmail.com>2017-08-20 14:47:15 +0200
commitc36fd5a174ab74465b8562c5fb4fa69a25dfca79 (patch)
treecebd29dfb75e4713934a995ad13b957769194e7d /Main.hs
parentf8d264f2b18fccdc3b96d8fb66656128a25137f2 (diff)
Fourth
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Main.hs b/Main.hs
index dd07952..b8c50e6 100644
--- a/Main.hs
+++ b/Main.hs
@@ -28,11 +28,8 @@ tracePrettyId x = trace (pretty x) x
eitherToIO :: Either String a -> IO a
eitherToIO = either die return
-
-main :: IO ()
-main = do
- source <- getContents
-
+performCompile :: String -> IO ()
+performCompile source = do
let eres = return source
>>= parseProgram <?> "Parse error"
>>= typeCheck <?> "Type error"
@@ -53,3 +50,6 @@ main = do
hPutStrLn stderr "Linking with ld..."
callCommand "ld z_output.o liblang.o -o z_output"
+
+main :: IO ()
+main = getContents >>= performCompile