diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/check-exact/ExactPrint.hs | 9 | ||||
-rw-r--r-- | utils/check-exact/Lookup.hs | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs index df7fdfda1e..a3332f5f19 100644 --- a/utils/check-exact/ExactPrint.hs +++ b/utils/check-exact/ExactPrint.hs @@ -63,6 +63,7 @@ import Data.Functor.Const import qualified Data.Set as Set import Data.Typeable import Data.List ( partition, sort, sortBy) +import qualified Data.List.NonEmpty as NE import Data.Maybe ( isJust, mapMaybe ) import Data.Void @@ -4548,6 +4549,7 @@ instance ExactPrint (Pat GhcPs) where getAnnotationEntry (NPat an _ _ _) = fromAnn an getAnnotationEntry (NPlusKPat an _ _ _ _ _) = fromAnn an getAnnotationEntry (SigPat an _ _) = fromAnn an + getAnnotationEntry (OrPat an _) = fromAnn an setAnnotationAnchor a@(WildPat _) _ _s = a setAnnotationAnchor a@(VarPat _ _) _ _s = a @@ -4565,6 +4567,7 @@ instance ExactPrint (Pat GhcPs) where setAnnotationAnchor (NPat an a b c) anc cs = (NPat (setAnchorEpa an anc cs) a b c) setAnnotationAnchor (NPlusKPat an a b c d e) anc cs = (NPlusKPat (setAnchorEpa an anc cs) a b c d e) setAnnotationAnchor (SigPat an a b) anc cs = (SigPat (setAnchorEpa an anc cs) a b) + setAnnotationAnchor (OrPat an a) anc cs = (OrPat (setAnchorEpa an anc cs) a) exact (WildPat w) = do anchor <- getAnchorU @@ -4654,6 +4657,12 @@ instance ExactPrint (Pat GhcPs) where sig' <- markAnnotated sig return (SigPat an0 pat' sig') + exact (OrPat an pats) = do + an0 <- markEpAnnL an lidl AnnOne + an1 <- markEpAnnL an0 lidl AnnOf + pats' <- markAnnotated (NE.toList pats) + return (OrPat an1 (NE.fromList pats')) + -- --------------------------------------------------------------------- instance ExactPrint (HsPatSigType GhcPs) where diff --git a/utils/check-exact/Lookup.hs b/utils/check-exact/Lookup.hs index d3a7df6c2a..1ba37d05dd 100644 --- a/utils/check-exact/Lookup.hs +++ b/utils/check-exact/Lookup.hs @@ -76,6 +76,7 @@ keywordToString kw = AnnModule -> "module" AnnNewtype -> "newtype" AnnOf -> "of" + AnnOne -> "one" AnnOpenB -> "(|" AnnOpenBU -> "⦇" AnnOpenC -> "{" |