Commit c040a3a1 authored by bbr's avatar bbr
Browse files

Small problem with make fixed

parent caad81a4
......@@ -59,7 +59,7 @@ process done test act modu = do
--- a standard test if a given file is newer than a list of other files
--- if other files do not exist, the given file is assumed to be up-to-date
--- on up-to-date files a given action is performed
obsolete :: (String -> String) -> [String -> String] -> (String -> IO a) -> TestAct a
obsolete :: (String -> String) -> [String -> String] -> ([String] -> IO a) -> TestAct a
obsolete f fs action dir modu = do
let fn = dir++f modu
fns = map ((dir++).($modu)) fs
......@@ -73,7 +73,7 @@ obsolete f fs action dir modu = do
return Nothing
else do
putStrLn $ "up-to-date: " ++ f modu
action fn >>= return . Just
action fns >>= return . Just
else putStrLn ("missing : "++ f modu) >>
return Nothing
where
......
......@@ -39,10 +39,10 @@ transform :: Bool -> Bool -> String -> IO ()
--transform _ False mod = readFlatCurry mod >>= writeTrans "" [] >> return ()
transform force _ mod = make mod tester writeTrans
where
tester = if force then (\ fn _ -> readTypes fn >>= return . Just)
tester = if force then (\ fn _ -> readTypes [fn] >>= return . Just)
else obsolete (addFcy . addOrc) [addFcy] readTypes
readTypes fn = do
prog <- readFile fn
readTypes fns = do
prog <- readFile (head fns)
let typeString = dropWhile (/='[') $ dropWhile (/=']') $ dropWhile (/='[') prog
types = fst $ head $ readsTerm typeString
return $ filter hasHOTypeArg types
......
......@@ -101,8 +101,8 @@ transform stFile force progName = make progName tester (writeTrans stFile)
where
tester = if force then (\ _ _ -> return Nothing)
else obsolete targetName [addFcy,incName,trustName] readTypes
readTypes fn = do
prog <- readFile fn
readTypes fns = do
prog <- readFile (head fns)
let typeString = dropWhile (/='[') $ dropWhile (/=']') $ dropWhile (/='[') prog
types = fst $ head $ readsTerm typeString
return $ makeConsTable types
......
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