diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2021-10-06 20:28:52 +0100 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2021-10-06 20:36:45 +0100 |
commit | 085f46fc37003172c963ecc219c701ec4d3af953 (patch) | |
tree | 00f0edaae194987acc341ffac8ad00babc377d93 /compiler/GHC/Parser/PostProcess.hs | |
parent | a466b02492f73a43c6cb9ce69491fc85234b9559 (diff) | |
download | haskell-wip/az/epadelta-comments.tar.gz |
EPA: Add comments to EpaDeltawip/az/epadelta-comments
The EpaDelta variant of EpaLocation cannot be sorted by location.
So we capture any comments that need to be printed between the prior
output and this location, when creating an EpaDelta offset in ghc-exactprint.
And make the EpaLocation fields strict.
Diffstat (limited to 'compiler/GHC/Parser/PostProcess.hs')
-rw-r--r-- | compiler/GHC/Parser/PostProcess.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index 198a14ec72..ae19e7b7b3 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -456,7 +456,7 @@ add_where an@(AddEpAnn _ (EpaSpan rs)) (EpAnn a (AnnList anc o c r t) cs) cs2 add_where an@(AddEpAnn _ (EpaSpan rs)) EpAnnNotUsed cs = EpAnn (Anchor rs UnchangedAnchor) (AnnList (Just $ Anchor rs UnchangedAnchor) Nothing Nothing [an] []) cs -add_where (AddEpAnn _ (EpaDelta _)) _ _ = panic "add_where" +add_where (AddEpAnn _ (EpaDelta _ _)) _ _ = panic "add_where" -- EpaDelta should only be used for transformations valid_anchor :: RealSrcSpan -> Bool @@ -3011,7 +3011,7 @@ token_location_widenR NoTokenLoc _ = NoTokenLoc token_location_widenR tl (UnhelpfulSpan _) = tl token_location_widenR (TokenLoc (EpaSpan r1)) (RealSrcSpan r2 _) = (TokenLoc (EpaSpan (combineRealSrcSpans r1 r2))) -token_location_widenR (TokenLoc (EpaDelta _)) _ = +token_location_widenR (TokenLoc (EpaDelta _ _)) _ = -- Never happens because the parser does not produce EpaDelta. panic "token_location_widenR: EpaDelta" |