]> ruin.nu Git - proglang.git/blobdiff - Interpreter.hs
minor change
[proglang.git] / Interpreter.hs
index 6cfbbda91af2804ac58cd53a96a1447e4dd1cea0..ae73abba4a1cff690a8bab18e84c977298c73809 100644 (file)
@@ -13,8 +13,6 @@ import Abssyntax
 
 import Typecheck
 import Interpret
-import Control.Monad.State hiding (State)
-import Data.Map as Map hiding (showTree)
 
 import ErrM
 
@@ -45,12 +43,11 @@ 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 (do mapM Typecheck.addFunction fun; mapM typeCheckFunction fun; mapM typeCheckStm st) Typecheck.emptyState
+               typeCheck fun st
                print "The program is type-correct!!"
                print "Running program:"
-               runStateT (do mapM Interpret.addFunction fun; mapM execute st) Interpret.emptyState
+               interpret fun st
                print "Done running program!"
-               return ()
 
 showTree :: (Show a, Print a) => Int -> a -> IO ()
 showTree v tree