diff options
| author | Ian Lynagh <igloo@earth.li> | 2011-07-14 19:59:13 +0100 |
|---|---|---|
| committer | Ian Lynagh <igloo@earth.li> | 2011-07-14 19:59:13 +0100 |
| commit | 493ea4ab0bcdfdd99aa08ce3637ab383e1f8fc2d (patch) | |
| tree | 056ca24bd0b716788918d19dbadcb4ae2190a38c /compiler/parser | |
| parent | 9652dab10c20ffbfaa50a56b786d430d62d27411 (diff) | |
| download | haskell-493ea4ab0bcdfdd99aa08ce3637ab383e1f8fc2d.tar.gz | |
Separate the warning flags into their own datatype
The -w flag wasn't turning off a few warnings (Opt_WarnMissingImportList,
Opt_WarnMissingLocalSigs, Opt_WarnIdentities). Rather than just adding
them, I've separated the Opt_Warn* contructors off into their own type,
so -w now just sets the list of warning flags to [].
Diffstat (limited to 'compiler/parser')
| -rw-r--r-- | compiler/parser/Lexer.x | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index c043f8bdff..fd1e1afa05 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1445,12 +1445,12 @@ lex_quasiquote s = do -- ----------------------------------------------------------------------------- -- Warnings -warn :: DynFlag -> SDoc -> Action +warn :: WarningFlag -> SDoc -> Action warn option warning srcspan _buf _len = do addWarning option (RealSrcSpan srcspan) warning lexToken -warnThen :: DynFlag -> SDoc -> Action -> Action +warnThen :: WarningFlag -> SDoc -> Action -> Action warnThen option warning action srcspan buf len = do addWarning option (RealSrcSpan srcspan) warning action srcspan buf len @@ -1878,11 +1878,11 @@ mkPState flags buf loc = b `setBitIf` cond | cond = bit b | otherwise = 0 -addWarning :: DynFlag -> SrcSpan -> SDoc -> P () +addWarning :: WarningFlag -> SrcSpan -> SDoc -> P () addWarning option srcspan warning = P $ \s@PState{messages=(ws,es), dflags=d} -> let warning' = mkWarnMsg srcspan alwaysQualify warning - ws' = if dopt option d then ws `snocBag` warning' else ws + ws' = if wopt option d then ws `snocBag` warning' else ws in POk s{messages=(ws', es)} () getMessages :: PState -> Messages |
