diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2022-06-22 21:09:22 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-07-06 13:50:27 -0400 |
commit | c5415bc5c428df72f3943fd9bf117355ae746fdb (patch) | |
tree | 77815ece007b099a96aa55b3e898cf4d99b58d6a /utils | |
parent | fd379d1b8e709f4eaa20a969bf9fffd40b8a4433 (diff) | |
download | haskell-c5415bc5c428df72f3943fd9bf117355ae746fdb.tar.gz |
Fix exact printing of the HsRule name
Prior to this branch, the HsRule name was
XRec pass (SourceText,RuleName)
and there is an ExactPrint instance for (SourceText, RuleName).
The SourceText has moved to a different location, so synthesise the
original to trigger the correct instance when printing.
We need both the SourceText and RuleName when exact printing, as it is
possible to have a NoSourceText variant, in which case we fall back to
the FastString.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/check-exact/ExactPrint.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs index ef2e98841b..eecb1e28eb 100644 --- a/utils/check-exact/ExactPrint.hs +++ b/utils/check-exact/ExactPrint.hs @@ -1037,9 +1037,9 @@ instance ExactPrint (RuleDecls GhcPs) where instance ExactPrint (RuleDecl GhcPs) where getAnnotationEntry (HsRule {rd_ext = (an,_)}) = fromAnn an - exact (HsRule (an,_) ln act mtybndrs termbndrs lhs rhs) = do + exact (HsRule (an,nsrc) (L ln n) act mtybndrs termbndrs lhs rhs) = do debugM "HsRule entered" - markAnnotated ln + markAnnotated (L ln (nsrc, n)) debugM "HsRule after ln" markActivation an ra_rest act debugM "HsRule after act" |