diff options
Diffstat (limited to 'brainfuck.hs')
-rw-r--r-- | brainfuck.hs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/brainfuck.hs b/brainfuck.hs deleted file mode 100644 index 5f13ae6..0000000 --- a/brainfuck.hs +++ /dev/null @@ -1,30 +0,0 @@ - -import System.Environment( getArgs ) -import Control.Exception( ErrorCall(..), Handler(..), catches ) -import Brainfuck.Parser -import Brainfuck.Interpreter - - - - -usageString :: String -usageString = "Usage: brainfuck <program file>" - - - -program :: IO () -program = do - args <- getArgs - fileContents <- if (length args /= 1) - then error usageString - else readFile (head args) - - case (parseBrainfuck fileContents) of - Left x -> putStrLn (show x) - Right x -> brainfuck x >> return () - - - -main = catches program - [ Handler ((\e -> putStrLn . show $ e) :: ErrorCall -> IO ()) ] - |