diff options
author | simonpj@microsoft.com <unknown> | 2006-09-04 13:14:12 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2006-09-04 13:14:12 +0000 |
commit | 56dfaffd65d96d27a74c906c2201fd392e06f154 (patch) | |
tree | 5a4652e02c4d8cd7638384af31c3ba66c5b62584 /compiler/parser | |
parent | edbfd324eec5773496119e12ef25e1ce3da1796d (diff) | |
download | haskell-56dfaffd65d96d27a74c906c2201fd392e06f154.tar.gz |
Enable bang-patterns only when the flag says so (had missed a case before)
Diffstat (limited to 'compiler/parser')
-rw-r--r-- | compiler/parser/RdrHsSyn.lhs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/parser/RdrHsSyn.lhs b/compiler/parser/RdrHsSyn.lhs index cd82da1be4..2e846a518d 100644 --- 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)) - 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 -> |