Commit 73aa002f authored by Bernd Brassel's avatar Bernd Brassel
Browse files

- one source for runtime errors eliminate

- fixed :type command in kicsi
parent c1dcf1c7
name: KiCS
version: 0.3
version: 0.8.3
Author: Bernd Braßel
Homepage: http://www.informatik.uni-kiel.de/prog/mitarbeiter/bernd-brassel/projects/
Category: Compiler
......
......@@ -33,6 +33,7 @@ instance Monad (Safe IO) where
fail s = Safe (putStrLn s >> return Nothing)
safeSystem :: Bool -> String -> Safe IO ()
safeSystem _ "" = Safe $ return (Just ())
safeSystem verbose sysCall = Safe $ do
if verbose then putStrLn sysCall else return ()
ec <- system sysCall
......
......@@ -256,7 +256,7 @@ getType expr state opts = do
t <- (safe $ do
genReqModule (loadedFiles state) expr
cymake (opts{filename=reqModuleName})
p <- safeIO (readFlatCurry (reqModuleName++".fcy"))
p <- safeIO (readFlatCurry reqModuleFile)
let (f:_) = filter ((=="expression") . snd . funcName) (progFuncs p)
return (funcType f))
maybe (return ()) (putStrLn . showCurryType snd False) t
......@@ -327,7 +327,7 @@ requestCall state opts@Opts{eval=True} =
requestCall state _ = (inKicsSubdir "request"++" "++cmdLineArgs state++" +RTS "++rts state)
reqModuleName = "Request"
reqModuleFile = inKicsSubdir reqModuleName
reqModuleFile = replaceExtension (inKicsSubdir reqModuleName) ".fcy"
genReqModule fs line =
safeIO (writeKicsFile (replaceExtension reqModuleName ".curry")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment