summaryrefslogtreecommitdiff
path: root/main.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-01-24 13:06:02 +0100
committertomsmeding <tom.smeding@gmail.com>2017-01-24 13:06:02 +0100
commit68a49640d7cf05c3149da266e820c5ce464aadf8 (patch)
treecdd0f829de9d6a23065a88ca9d47a40c8a6de428 /main.hs
parented225559cd9b54fd0cc696088ad1ed13d51aae04 (diff)
Generate code for global variables
Diffstat (limited to 'main.hs')
-rw-r--r--main.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.hs b/main.hs
index 962a01d..7828034 100644
--- a/main.hs
+++ b/main.hs
@@ -5,6 +5,7 @@ import Data.Either
import System.Environment
import System.Exit
+import Check
import Codegen
import Parser
import PShow
@@ -33,7 +34,12 @@ main = do
when (isLeft parseResult) $ dieShow $ fromLeft parseResult
let ast = fromRight parseResult
- -- print ast
putStrLn $ pshow ast
- either die print $ codegen ast "Module" fname
+ checked <- either die return $ checkProgram ast
+ putStrLn "After checking:"
+ putStrLn $ pshow checked
+
+ llvmMod <- either die return $ codegen checked "Module" fname
+ putStrLn "Module:"
+ print llvmMod