X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=CompInt.hs;h=298c9f49c8ae3a50fcf220e393bdf99ed994c1bd;hp=1188466da980b4d1886b4d3deff9d5e199fa08fc;hb=4ab526ea4f2ad39b6797adbc9df0fd26ac571456;hpb=cfe5796efb06251047f77bf9d2295d7093910292 diff --git a/CompInt.hs b/CompInt.hs index 1188466..298c9f4 100644 --- a/CompInt.hs +++ b/CompInt.hs @@ -49,6 +49,10 @@ main = do args <- getArgs case args of [] -> hGetContents stdin >>= run interpret pStms - "-c":f:[] -> runFile (writeFile (f++".c") . compile) pStms f + "-c":f:[] -> let file = (f++".c") in do + putStrLn $ "Compiling "++f++" to the C99-compatible file:"++file + runFile (writeFile file . compile) pStms f f:[] -> runFile interpret pStms f - _ -> print "Too many arguments" + _ -> do + putStrLn "Usage: ./CompInt [-c] " + putStrLn "-c : compile to C99-compatible file"