Commit 6c214007 authored by Kirchmayr's avatar Kirchmayr
Browse files

Merge branch 'master' into DoubleVarBug

parents 5a4b04af 38cb35e0
......@@ -165,7 +165,7 @@ data WarnFlag
-- |Warning flags enabled by default
stdWarnFlags :: [WarnFlag]
stdWarnFlags =
[ WarnMultipleImports , WarnDisjoinedRules, WarnUnusedBindings
[ WarnMultipleImports , WarnDisjoinedRules --, WarnUnusedBindings
, WarnNameShadowing , WarnOverlapping , WarnIncompletePatterns
, WarnMissingSignatures
]
......
......@@ -118,7 +118,7 @@ showAttributes (IntAttributes i _) = show i
showAttributes (FloatAttributes f _) = show f
showAttributes (StringAttributes s _) = show s
showAttributes (IdentAttributes m i) = "\"" ++ (intercalate "." (m ++ [i])) ++ "\""
showAttributes (OptionsAttributes t a) = "\"" ++ (show t ++ ' ' : show a) ++ "\""
showAttributes (OptionsAttributes t a) = "(" ++ show t ++ ")" ++ ' ' : show a
-- Concatenate two 'String's with a smart space in between,
-- which is only added if both 'String's are non-empty
......@@ -126,4 +126,3 @@ showAttributes (OptionsAttributes t a) = "\"" ++ (show t ++ ' ' : show a) ++ "\
[] +++ t = t
s +++ [] = s
s +++ t = s ++ ' ' : t
......@@ -35,7 +35,7 @@ import Curry.Base.Message (Message, message, ppMessages, ppError)
import Curry.Base.Monad (CYIO, runCYIO)
import Curry.Base.Pretty (text)
import qualified CompilerOpts as CO ( Options (..), WarnOpts (..)
, Verbosity (VerbQuiet)
, WarnFlag (..), Verbosity (VerbQuiet)
, defaultOptions, defaultWarnOpts)
import CurryBuilder (buildCurry)
......@@ -50,7 +50,11 @@ runSecure act = runCYIO act `E.catch` handler
runTest :: CO.Options -> String -> [String] -> IO Progress
runTest opts test [] = passOrFail <$> runSecure (buildCurry opts' test)
where
opts' = opts { CO.optForce = True }
wOpts = CO.optWarnOpts opts
wFlags = CO.WarnUnusedBindings : CO.wnWarnFlags wOpts
opts' = opts { CO.optForce = True
, CO.optWarnOpts = wOpts { CO.wnWarnFlags = wFlags }
}
passOrFail = Finished . either fail pass
fail msgs
| null msgs = Pass
......@@ -58,7 +62,11 @@ runTest opts test [] = passOrFail <$> runSecure (buildCurry opts' test)
pass _ = Pass
runTest opts test errorMsgs = catchE <$> runSecure (buildCurry opts' test)
where
opts' = opts { CO.optForce = True }
wOpts = CO.optWarnOpts opts
wFlags = CO.WarnUnusedBindings : CO.wnWarnFlags wOpts
opts' = opts { CO.optForce = True
, CO.optWarnOpts = wOpts { CO.wnWarnFlags = wFlags }
}
catchE = Finished . either pass fail
pass msgs = let errorStr = showMessages msgs
in if all (`isInfixOf` errorStr) errorMsgs
......
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