]> ruin.nu Git - proglang.git/blobdiff - Typechecker.hs
typechecking of functions added, not function calls yet though
[proglang.git] / Typechecker.hs
index 8828fbeab974b228fead9839c44491f20d6114a7..71810e698b7854109d0f728951f504b25ab45cda 100644 (file)
@@ -45,7 +45,7 @@ run v p s = let ts = myLLexer s in case p ts of
        Ok (Program s) -> let (fun,st) = splitFunStm (s) in do
                putStrLn "\nParse Successful!"
                showTree v (Program s)
-               runStateT (mapM typeCheckStm st) State{variables=[empty], functions=[empty], function=(Ident "")}
+               runStateT (do mapM addFunction fun; mapM typeCheckFunction fun; mapM typeCheckStm st) State{variables=[empty], functions=(empty), function=(Ident "")}
                print "The program is type-correct!!"
                return ()