projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d3051c
)
Improve error report for pattern guards
author
simonpj@microsoft.com
<unknown>
Mon, 6 Feb 2006 10:17:30 +0000
(10:17 +0000)
committer
simonpj@microsoft.com
<unknown>
Mon, 6 Feb 2006 10:17:30 +0000
(10:17 +0000)
ghc/compiler/rename/RnBinds.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/rename/RnBinds.lhs
b/ghc/compiler/rename/RnBinds.lhs
index
1ea8f61
..
7ee82b5
100644
(file)
--- a/
ghc/compiler/rename/RnBinds.lhs
+++ b/
ghc/compiler/rename/RnBinds.lhs
@@
-604,11
+604,12
@@
rnGRHS ctxt = wrapLocFstM (rnGRHS' ctxt)
rnGRHS' ctxt (GRHS guards rhs)
= do { opt_GlasgowExts <- doptM Opt_GlasgowExts
rnGRHS' ctxt (GRHS guards rhs)
= do { opt_GlasgowExts <- doptM Opt_GlasgowExts
- ; checkM (opt_GlasgowExts || is_standard_guard guards)
- (addWarn (nonStdGuardErr guards))
-
; ((guards', rhs'), fvs) <- rnStmts (PatGuard ctxt) guards $
rnLExpr rhs
; ((guards', rhs'), fvs) <- rnStmts (PatGuard ctxt) guards $
rnLExpr rhs
+
+ ; checkM (opt_GlasgowExts || is_standard_guard guards')
+ (addWarn (nonStdGuardErr guards'))
+
; return (GRHS guards' rhs', fvs) }
where
-- Standard Haskell 1.4 guards are just a single boolean
; return (GRHS guards' rhs', fvs) }
where
-- Standard Haskell 1.4 guards are just a single boolean
@@
-654,8
+655,7
@@
bindsInHsBootFile mbinds
= hang (ptext SLIT("Bindings in hs-boot files are not allowed"))
2 (ppr mbinds)
= hang (ptext SLIT("Bindings in hs-boot files are not allowed"))
2 (ppr mbinds)
-nonStdGuardErr guard
- = hang (ptext
- SLIT("accepting non-standard pattern guards (-fglasgow-exts to suppress this message)")
- ) 4 (ppr guard)
+nonStdGuardErr guards
+ = hang (ptext SLIT("accepting non-standard pattern guards (-fglasgow-exts to suppress this message)"))
+ 4 (interpp'SP guards)
\end{code}
\end{code}