aboutsummaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
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