Commit 1a8e3a76 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Compile warnings under ghc 7.0.3 removed

parent a286178c
......@@ -22,21 +22,25 @@ checkTypeDecls ts1 [] = null ts1
checkTypeDecls ts1 ((Type qname vis2 is2 cs2):ts2') =
let (mt,ts1') = extract (isDataType qname) ts1
in maybe False
(\ (Type _ vis1 is1 cs1)
-> vis1 == vis2
(\ t -> case t of
(Type _ vis1 is1 cs1) ->
vis1 == vis2
&& is1 == is2
&& checkConsDecls cs1 cs2
&& checkTypeDecls ts1' ts2'
_ -> error "Check.InterfaceCheck.checkTypeDecls: no Type"
)
mt
checkTypeDecls ts1 ((TypeSyn qname vis2 is2 texpr2):ts2') =
let (mt,ts1') = extract (isTypeSyn qname) ts1
in maybe False
(\ (TypeSyn _ vis1 is1 texpr1)
-> vis1 == vis2
(\ t -> case t of
(TypeSyn _ vis1 is1 texpr1) ->
vis1 == vis2
&& is1 == is2
&& texpr1 == texpr2
&& checkTypeDecls ts1' ts2'
_ -> error "Check.InterfaceCheck.checkTypeDecls: no TypeSyn"
)
mt
......
......@@ -247,14 +247,17 @@ genFuncDecl isLocal env ident decls
= let qname = genQName False env (qualify ident)
visibility = genVisibility env ident
evalannot = maybe CFlex
(\ (EvalAnnot _ _ ea) -> genEvalAnnot ea)
(\ x -> case x of
(EvalAnnot _ _ ea) -> genEvalAnnot ea
_ -> error "Gen.GenAbstractCurry.genFuncDecl: no Eval Annotation")
(find isEvalAnnot decls)
(mtype, env1) = maybe (Nothing, env)
(\ (t, env') -> (Just t, env'))
(genFuncType env decls)
(rules, env2) = maybe ([], env1)
(\ (FunctionDecl _ _ equs)
-> mapfoldl genRule env1 equs)
(\ d -> case d of
(FunctionDecl _ _ equs) -> mapfoldl genRule env1 equs
_ -> error "Gen.GenAbstractCurry.genFuncDecl: no FunctionDecl")
(find isFunctionDecl decls)
mexternal = fmap genExternal (find isExternal decls)
arity = compArity mtype rules
......
......@@ -191,8 +191,7 @@ visitModule (IL.Module mid imps decls) = do
modid <- visitModuleIdent mid
imps' <- imports
is <- mapM visitModuleIdent
(nub (imps ++ (map (\ (CS.IImportDecl _ mid1)
-> mid1) imps')))
(nub (imps ++ (map extractMid imps')))
return (Prog modid is (recrds ++ types ++ datas) funcs ops))
(do ops <- genOpDecls
ds <- filterM isPublicDataDecl decls
......@@ -208,13 +207,16 @@ visitModule (IL.Module mid imps decls) = do
modid <- visitModuleIdent mid
imps' <- imports
is <- mapM visitModuleIdent
(nub (imps ++ (map (\ (CS.IImportDecl _ mid1)
-> mid1) imps')))
(nub (imps ++ (map extractMid imps')))
return (Prog modid
is
(itypes ++ recrds ++ types ++ datas)
(ifuncs ++ funcs)
(iops ++ ops)))
where
extractMid d = case d of
(CS.IImportDecl _ mid1) -> mid1
_ -> error "Gen.GenFlatCurry.visitModule: no IImportDecl"
--
visitDataDecl :: IL.Decl -> FlatState TypeDecl
......
......@@ -4,7 +4,7 @@
AbstractCurry) for a Curry source file including all imported modules.
September 2005, Martin Engelke (men@informatik.uni-kiel.de)
February 2011, Björn Peemöller (bjp@informatik.uni-kiel.de)
May 2011, Björn Peemöller (bjp@informatik.uni-kiel.de)
-}
module Main (main) where
......@@ -29,6 +29,7 @@ cymake :: String -> (Options, [String], [String]) -> IO ()
cymake prog (opts, files, errs)
| help opts = printUsage prog
| version opts = printVersion
| null files = printUsage prog
| not (null errs') = badUsage prog errs'
| html opts = mapM_ (source2html opts) files
| otherwise = info opts cymakeGreeting
......@@ -49,8 +50,6 @@ badUsage prog errs = do
-- |Check options and files and return a list of error messages
check :: Options -> [String] -> [String]
check opts files
| null files
= ["no files"]
| isJust (output opts) && length files > 1
= ["cannot specify -o with multiple targets"]
| otherwise
......
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