X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Interpret.hs;h=fd04dcd722d9e33d8b65a70c292c96bd161e48e4;hp=8ac65bf247c9acf10699573d40669e65ca43782b;hb=d553df8dfdffca78342d6fae142ceded9cd64415;hpb=92fd10b102519d03741d61c2679c4cfbe1b486a4 diff --git a/Interpret.hs b/Interpret.hs index 8ac65bf..fd04dcd 100644 --- a/Interpret.hs +++ b/Interpret.hs @@ -109,6 +109,10 @@ execute (SBlock ss) = pushAndPop $ mapM execute ss execute (SWhile e s) = do (VBool b) <- eval e if b then pushAndPop (execute s) >> execute (SWhile e s) else return () +execute (SDeclD t i) = execute (SDecl t i $ case t of + TInt -> EInt 0 + TBool -> EBool False + ) execute (SDecl t i e) =do e' <- eval e (m:ms) <- get