diff options
Diffstat (limited to 'utils/check-exact/Types.hs')
-rw-r--r-- | utils/check-exact/Types.hs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/utils/check-exact/Types.hs b/utils/check-exact/Types.hs index 381d157e8b..b50a0b9d86 100644 --- a/utils/check-exact/Types.hs +++ b/utils/check-exact/Types.hs @@ -45,9 +45,16 @@ instance Ord Comment where -- When we have CPP injected comments with a fake filename, or LINE -- pragma, the file name changes, so we need to compare the -- locations only, with out the filename. - compare (Comment _ ss1 _ _) (Comment _ ss2 _ _) = compare (ss2pos $ anchor ss1) (ss2pos $ anchor ss2) - where - ss2pos ss = (srcSpanStartLine ss,srcSpanStartCol ss) + -- compare (Comment _ ss1 _ _) (Comment _ ss2 _ _) = compare (ss2pos $ anchor ss1) (ss2pos $ anchor ss2) + compare (Comment _ ss1 _ _) (Comment _ ss2 _ _) = compare ss1 ss2 + +ss2pos :: RealSrcSpan -> Pos +ss2pos ss = (srcSpanStartLine ss,srcSpanStartCol ss) + +instance Ord EpaLocation where + compare (EpaSpan (RealSrcSpan l1 m1)) (EpaSpan (RealSrcSpan l2 m2)) = compare (ss2pos l1, m1) (ss2pos l2, m2) + compare _ _ = EQ + instance Outputable Comment where ppr x = text (show x) |