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