summaryrefslogtreecommitdiff
path: root/compiler/deSugar/Coverage.lhs
diff options
context:
space:
mode:
authorMikhail Vorozhtsov <mikhail.vorozhtsov@gmail.com>2012-07-15 00:53:52 +0700
committerSimon Marlow <marlowsd@gmail.com>2012-07-16 11:09:40 +0100
commitcc456b0be3f20a1c1cef4154ae40ac18f4f6711e (patch)
tree0ca2bc0cdfabd6f4c6e3e0a94170baae71d634c0 /compiler/deSugar/Coverage.lhs
parentb1e97f2f325537664f09eee7ea0e7c53264b061e (diff)
downloadhaskell-cc456b0be3f20a1c1cef4154ae40ac18f4f6711e.tar.gz
Implemented MultiWayIf extension.
Diffstat (limited to 'compiler/deSugar/Coverage.lhs')
-rw-r--r--compiler/deSugar/Coverage.lhs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs
index 28d83c9dc5..ff3cfc5189 100644
--- a/compiler/deSugar/Coverage.lhs
+++ b/compiler/deSugar/Coverage.lhs
@@ -423,6 +423,7 @@ isGoodBreakExpr (HsApp {}) = True
isGoodBreakExpr (OpApp {}) = True
isGoodBreakExpr (NegApp {}) = True
isGoodBreakExpr (HsIf {}) = True
+isGoodBreakExpr (HsMultiIf {}) = True
isGoodBreakExpr (HsCase {}) = True
isGoodBreakExpr (RecordCon {}) = True
isGoodBreakExpr (RecordUpd {}) = True
@@ -496,6 +497,10 @@ addTickHsExpr (HsIf cnd e1 e2 e3) =
(addBinTickLHsExpr (BinBox CondBinBox) e1)
(addTickLHsExprOptAlt True e2)
(addTickLHsExprOptAlt True e3)
+addTickHsExpr (HsMultiIf ty alts)
+ = do { let isOneOfMany = case alts of [_] -> False; _ -> True
+ ; alts' <- mapM (liftL $ addTickGRHS isOneOfMany False) alts
+ ; return $ HsMultiIf ty alts' }
addTickHsExpr (HsLet binds e) =
bindLocals (collectLocalBinders binds) $
liftM2 HsLet