diff options
Diffstat (limited to 'utils/check-exact')
-rw-r--r-- | utils/check-exact/ExactPrint.hs | 12 | ||||
-rw-r--r-- | utils/check-exact/Main.hs | 6 |
2 files changed, 12 insertions, 6 deletions
diff --git a/utils/check-exact/ExactPrint.hs b/utils/check-exact/ExactPrint.hs index eecb1e28eb..8ec3adbf46 100644 --- a/utils/check-exact/ExactPrint.hs +++ b/utils/check-exact/ExactPrint.hs @@ -30,8 +30,9 @@ import GHC.Data.FastString import GHC.Types.Basic hiding (EP) import GHC.Types.Fixity import GHC.Types.ForeignCall -import GHC.Types.SourceText +import GHC.Types.Name.Reader import GHC.Types.PkgQual +import GHC.Types.SourceText import GHC.Types.Var import GHC.Utils.Outputable hiding ( (<>) ) import GHC.Unit.Module.Warnings @@ -39,6 +40,8 @@ import GHC.Utils.Misc import GHC.Utils.Panic import GHC.TypeLits +import Language.Haskell.Syntax.Basic (FieldLabelString(..)) + import Control.Monad.Identity import Control.Monad.RWS import Data.Data ( Data ) @@ -47,7 +50,6 @@ import Data.Typeable import Data.List ( partition, sortBy) import Data.List.NonEmpty ( NonEmpty ) import Data.Maybe ( isJust ) - import Data.Void import Lookup @@ -2270,9 +2272,11 @@ instance ExactPrint (FieldLabelStrings GhcPs) where instance ExactPrint (DotFieldOcc GhcPs) where getAnnotationEntry (DotFieldOcc an _) = fromAnn an - exact (DotFieldOcc an fs) = do + exact (DotFieldOcc an (L loc (FieldLabelString fs))) = do markAnnKwM an afDot AnnDot - markAnnotated fs + -- The field name has a SrcSpanAnnN, print it as a + -- LocatedN RdrName + markAnnotated (L loc (mkVarUnqual fs)) -- --------------------------------------------------------------------- diff --git a/utils/check-exact/Main.hs b/utils/check-exact/Main.hs index 122c63990a..4272a8004c 100644 --- a/utils/check-exact/Main.hs +++ b/utils/check-exact/Main.hs @@ -38,7 +38,8 @@ import GHC.Data.FastString _tt :: IO () -- _tt = testOneFile changers "/home/alanz/mysrc/git.haskell.org/ghc/_build/stage1/lib" -- _tt = testOneFile changers "/home/alanz/mysrc/git.haskell.org/worktree/exactprint/_build/stage1/lib" -_tt = testOneFile changers "/home/alanz/mysrc/git.haskell.org/worktree/epw/_build/stage1/lib" +_tt = testOneFile changers "/home/alanz/mysrc/git.haskell.org/worktree/master/_build/stage1/lib" +-- _tt = testOneFile changers "/home/alanz/mysrc/git.haskell.org/worktree/epw/_build/stage1/lib" -- "../../testsuite/tests/ghc-api/exactprint/RenameCase1.hs" (Just changeRenameCase1) -- "../../testsuite/tests/ghc-api/exactprint/LayoutLet2.hs" (Just changeLayoutLet2) @@ -198,7 +199,8 @@ _tt = testOneFile changers "/home/alanz/mysrc/git.haskell.org/worktree/epw/_buil -- "../../testsuite/tests/printer/PprSemis.hs" Nothing -- "../../testsuite/tests/printer/PprEmptyMostly.hs" Nothing -- "../../testsuite/tests/parser/should_compile/DumpSemis.hs" Nothing - "../../testsuite/tests/ghc-api/exactprint/Test20239.hs" Nothing + -- "../../testsuite/tests/ghc-api/exactprint/Test20239.hs" Nothing + "../../testsuite/tests/printer/Test21805.hs" Nothing -- cloneT does not need a test, function can be retired |