From: sof Date: Wed, 17 Dec 1997 20:09:15 +0000 (+0000) Subject: [project @ 1997-12-17 20:09:12 by sof] X-Git-Tag: Approx_2487_patches~1150 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=faa411f2da3e120a5881060b57c834b13c427fa9 [project @ 1997-12-17 20:09:12 by sof] Renamed -fwarn-overlapped-patterns to -fwarn-overlapping-patterns to match driver (and docs.) --- diff --git a/ghc/compiler/deSugar/Match.lhs b/ghc/compiler/deSugar/Match.lhs index ed56ab7..ee9e8aa 100644 --- a/ghc/compiler/deSugar/Match.lhs +++ b/ghc/compiler/deSugar/Match.lhs @@ -18,7 +18,7 @@ import {-# SOURCE #-} DsExpr ( dsExpr ) import {-# SOURCE #-} DsBinds ( dsBinds ) #endif -import CmdLineOpts ( opt_WarnIncompletePatterns, opt_WarnOverlappedPatterns, +import CmdLineOpts ( opt_WarnIncompletePatterns, opt_WarnOverlappingPatterns, opt_PprUserLength,opt_WarnSimplePatterns ) import HsSyn @@ -90,7 +90,7 @@ matchExport vars qs@((EqnInfo _ ctx _ (MatchResult _ _ _)) : _) match vars qs where (pats,indexs) = check qs incomplete = opt_WarnIncompletePatterns && (length pats /= 0) - shadow = opt_WarnOverlappedPatterns && sizeUniqSet indexs < no_eqns + shadow = opt_WarnOverlappingPatterns && sizeUniqSet indexs < no_eqns no_eqns = length qs unused_eqns = uniqSetToList (mkUniqSet [1..no_eqns] `minusUniqSet` indexs) eqns_shadow = map (\n -> qs!!(n - 1)) unused_eqns @@ -99,6 +99,8 @@ matchExport vars qs@((EqnInfo _ ctx _ (MatchResult _ _ _)) : _) This variable shows the maximun number of lines of output generated for warnings. It will limit the number of patterns/equations displayed to maximum_output. +(ToDo: add command-line option?) + \begin{code} maximum_output = 4 \end{code} diff --git a/ghc/compiler/main/CmdLineOpts.lhs b/ghc/compiler/main/CmdLineOpts.lhs index eaf8caf..d6085f3 100644 --- a/ghc/compiler/main/CmdLineOpts.lhs +++ b/ghc/compiler/main/CmdLineOpts.lhs @@ -91,7 +91,7 @@ module CmdLineOpts ( opt_Verbose, opt_WarnNameShadowing, opt_WarnUnusedNames, - opt_WarnIncompletePatterns, opt_WarnOverlappedPatterns, opt_WarnSimplePatterns, + opt_WarnIncompletePatterns, opt_WarnOverlappingPatterns, opt_WarnSimplePatterns, opt_WarnMissingMethods, opt_WarnDuplicateExports, opt_PruneTyDecls, opt_PruneInstDecls, @@ -349,7 +349,7 @@ opt_LiberateCaseThreshold = lookup_def_int "-fliberate-case-threshold" lIBERA opt_UnfoldingKeenessFactor = lookup_def_float "-funfolding-keeness-factor" uNFOLDING_KEENESS_FACTOR opt_WarnNameShadowing = lookUp SLIT("-fwarn-name-shadowing") opt_WarnIncompletePatterns = lookUp SLIT("-fwarn-incomplete-patterns") -opt_WarnOverlappedPatterns = lookUp SLIT("-fwarn-overlapped-patterns") +opt_WarnOverlappingPatterns = lookUp SLIT("-fwarn-overlapping-patterns") opt_WarnSimplePatterns = lookUp SLIT("-fwarn-simple-patterns") opt_WarnUnusedNames = lookUp SLIT("-fwarn-unused-names") opt_WarnMissingMethods = lookUp SLIT("-fwarn-missing-methods")