Create print-based VM debugger
This commit is contained in:
@@ -3,13 +3,13 @@ module Main where
|
||||
import System.Environment
|
||||
import Control.Monad.Trans.Except (runExceptT, except)
|
||||
|
||||
import VirtualMachine.VM (VM)
|
||||
import VirtualMachine.VM (VM(..), empty)
|
||||
import VirtualMachine.Interpreter (run)
|
||||
import Assembler.Compiler (compile)
|
||||
import qualified Data.ByteString as B
|
||||
|
||||
interpret :: String -> IO (Either String VM)
|
||||
interpret input = runExceptT $ (except $ return $ input) >>= (except . compile) >>= (except . return . B.pack) >>= run
|
||||
interpret input = runExceptT $ (except $ return $ input) >>= (except . compile) >>= (except . return . B.pack) >>= run empty { _debug = False }
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
|
||||
Reference in New Issue
Block a user