diff --git a/src/Language/Haskell/GHC/ExactPrint/Utils.hs b/src/Language/Haskell/GHC/ExactPrint/Utils.hs index f92b9710..e2b9e0bd 100644 --- a/src/Language/Haskell/GHC/ExactPrint/Utils.hs +++ b/src/Language/Haskell/GHC/ExactPrint/Utils.hs @@ -296,7 +296,7 @@ insertTopLevelCppComments (HsModule (XModulePs an lo mdeprec mbDoc) mmn mexports (remaining, these) = case entry l of EpaSpan (RealSrcSpan s _) -> do - allocatePriorComments s cs + allocatePriorComments (ss2posEnd s) cs _ -> (cs, []) (EpAnn a anno ocs) = an :: EpAnn AnnsModule @@ -334,18 +334,17 @@ insertTopLevelCppComments (HsModule (XModulePs an lo mdeprec mbDoc) mmn mexports (rest, these) = case anc4 of EpaSpan (RealSrcSpan s _) -> - allocatePriorComments s cs' + allocatePriorComments (ss2pos s) cs' _ -> (cs', []) cs4' = workInComments cs4 these (xs',rest') = allocPreceding xs rest allocatePriorComments - :: RealSrcSpan + :: Pos -> [LEpaComment] -> ([LEpaComment], [LEpaComment]) -allocatePriorComments ss comment_q = +allocatePriorComments ss_loc comment_q = let - ss_loc = ss2pos ss cmp (L l _) = ss2pos (anchor l) <= ss_loc (newAnns,after) = partition cmp comment_q in diff --git a/tests/Test.hs b/tests/Test.hs index d33fe30d..25739637 100644 --- a/tests/Test.hs +++ b/tests/Test.hs @@ -214,9 +214,9 @@ tt' = do -- mkParserTestMD libdir "ghc80" "ForFree.hs" -- Current failures (roundtrip only) - mkParserTest libdir "ghc710" "Stmts.hs" + -- mkParserTest libdir "ghc710" "Stmts.hs" -- mkParserTest libdir "ghc80" "ForFree.hs" - -- "ContinuationIO.hs" + mkParserTest libdir "ghc96" "ContinuationIO.hs" -- Needs GHC changes