diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2021-08-22 09:13:30 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-08 16:58:51 -0400 |
commit | 86e5a6c34128a20d04808fcffcc49623a5d967bf (patch) | |
tree | 1d98c5a6049c707c66ab2b9c3247697d4578b4a8 /utils/check-exact/ExactPrint.hs | |
parent | 9fc0fe008c13782cb7b1962b0ebed0bb09ecfb6f (diff) | |
download | haskell-86e5a6c34128a20d04808fcffcc49623a5d967bf.tar.gz |
EPA: Capture '+' location for NPlusKPat
The location of the plus symbol was being discarded, we now capture
it.
Closes #20243
Diffstat (limited to 'utils/check-exact/ExactPrint.hs')
-rw-r--r-- | utils/check-exact/ExactPrint.hs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs index fc04e24332..29512e84b5 100644 --- a/utils/check-exact/ExactPrint.hs +++ b/utils/check-exact/ExactPrint.hs @@ -455,6 +455,9 @@ printStringAtMkw :: Maybe EpaLocation -> String -> EPP () printStringAtMkw (Just aa) s = printStringAtAA aa s printStringAtMkw Nothing s = printStringAtLsDelta (SameLine 1) s +printStringAtAnn :: EpAnn a -> (a -> EpaLocation) -> String -> EPP () +printStringAtAnn EpAnnNotUsed _ _ = return () +printStringAtAnn (EpAnn _ a _) f str = printStringAtAA (f a) str printStringAtAA :: EpaLocation -> String -> EPP () printStringAtAA (EpaSpan r) s = printStringAtKw' r s @@ -3603,12 +3606,17 @@ instance ExactPrint (Pat GhcPs) where markAnnotated ol -- | NPlusKPat an n lit1 lit2 _ _) + exact (NPlusKPat an n k _lit2 _ _) = do + markAnnotated n + printStringAtAnn an id "+" + markAnnotated k + + exact (SigPat an pat sig) = do markAnnotated pat markEpAnn an AnnDcolon markAnnotated sig - -- exact x = withPpr x - exact x = error $ "missing match for Pat:" ++ showAst x + -- exact x = error $ "missing match for Pat:" ++ showAst x -- --------------------------------------------------------------------- |