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:
edbfd32
)
Enable bang-patterns only when the flag says so (had missed a case before)
author
simonpj@microsoft.com
<unknown>
Mon, 4 Sep 2006 13:14:12 +0000
(13:14 +0000)
committer
simonpj@microsoft.com
<unknown>
Mon, 4 Sep 2006 13:14:12 +0000
(13:14 +0000)
compiler/parser/RdrHsSyn.lhs
patch
|
blob
|
history
diff --git
a/compiler/parser/RdrHsSyn.lhs
b/compiler/parser/RdrHsSyn.lhs
index
cd82da1
..
2e846a5
100644
(file)
--- a/
compiler/parser/RdrHsSyn.lhs
+++ b/
compiler/parser/RdrHsSyn.lhs
@@
-530,8
+530,12
@@
checkAPat loc e = case e of
NegApp (L _ (HsOverLit pos_lit)) _
-> return (mkNPat pos_lit (Just noSyntaxExpr))
NegApp (L _ (HsOverLit pos_lit)) _
-> return (mkNPat pos_lit (Just noSyntaxExpr))
- SectionR (L _ (HsVar bang)) e
- | bang == bang_RDR -> checkLPat e >>= (return . BangPat)
+ SectionR (L _ (HsVar bang)) e -- (! x)
+ | bang == bang_RDR
+ -> do { bang_on <- extension bangPatEnabled
+ ; if bang_on then checkLPat e >>= (return . BangPat)
+ else parseError loc "Illegal bang-pattern (use -fbang-patterns)" }
+
ELazyPat e -> checkLPat e >>= (return . LazyPat)
EAsPat n e -> checkLPat e >>= (return . AsPat n)
ExprWithTySig e t -> checkLPat e >>= \e ->
ELazyPat e -> checkLPat e >>= (return . LazyPat)
EAsPat n e -> checkLPat e >>= (return . AsPat n)
ExprWithTySig e t -> checkLPat e >>= \e ->