X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Typechecker.hs;h=19f5a6687e48373a196c6aba6178939a720485d9;hb=41bc48c79195f018687fef2ba64e4c87bb7a206b;hp=8828fbeab974b228fead9839c44491f20d6114a7;hpb=ff80cbdaf843e2745f59e6f5d3c8670cadbf68b2;p=proglang.git diff --git a/Typechecker.hs b/Typechecker.hs index 8828fbe..19f5a66 100644 --- a/Typechecker.hs +++ b/Typechecker.hs @@ -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) emptyState print "The program is type-correct!!" return ()