diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/check-exact/ExactPrint.hs | 4 | ||||
-rw-r--r-- | utils/check-exact/Utils.hs | 15 |
2 files changed, 3 insertions, 16 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs index e4f689bbbb..74135cb9f6 100644 --- a/utils/check-exact/ExactPrint.hs +++ b/utils/check-exact/ExactPrint.hs @@ -2080,14 +2080,12 @@ instance ExactPrint (HsExpr GhcPs) where -- --------------------------------------------------------------------- exactDo :: (ExactPrint body) - => EpAnn AnnList -> (HsStmtContext any) -> body -> EPP () + => EpAnn AnnList -> HsDoFlavour -> body -> EPP () exactDo an (DoExpr m) stmts = exactMdo an m AnnDo >> markAnnotatedWithLayout stmts exactDo an GhciStmtCtxt stmts = markLocatedAAL an al_rest AnnDo >> markAnnotatedWithLayout stmts -exactDo an ArrowExpr stmts = markLocatedAAL an al_rest AnnDo >> markAnnotatedWithLayout stmts exactDo an (MDoExpr m) stmts = exactMdo an m AnnMdo >> markAnnotatedWithLayout stmts exactDo _ ListComp stmts = markAnnotatedWithLayout stmts exactDo _ MonadComp stmts = markAnnotatedWithLayout stmts -exactDo _ _ _ = panic "pprDo" -- PatGuard, ParStmtCxt exactMdo :: EpAnn AnnList -> Maybe ModuleName -> AnnKeywordId -> EPP () exactMdo an Nothing kw = markLocatedAAL an al_rest kw diff --git a/utils/check-exact/Utils.hs b/utils/check-exact/Utils.hs index 5739df9dd3..74a861e773 100644 --- a/utils/check-exact/Utils.hs +++ b/utils/check-exact/Utils.hs @@ -207,19 +207,8 @@ orderByKey keys order -- --------------------------------------------------------------------- -isListComp :: HsStmtContext name -> Bool -isListComp cts = case cts of - ListComp -> True - MonadComp -> True - - DoExpr {} -> False - MDoExpr {} -> False - ArrowExpr -> False - GhciStmtCtxt -> False - - PatGuard {} -> False - ParStmtCtxt {} -> False - TransStmtCtxt {} -> False +isListComp :: HsDoFlavour -> Bool +isListComp = isDoComprehensionContext -- --------------------------------------------------------------------- |