Skip to content

Commit

Permalink
Use WithComments instead of GHC's types
Browse files Browse the repository at this point in the history
  • Loading branch information
toku-sa-n committed Sep 14, 2024
1 parent 4bb1d6b commit 957ba4f
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/HIndent/Ast/Module/Export/Entry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ module HIndent.Ast.Module.Export.Entry
) where

import GHC.Stack
import qualified GHC.Types.SrcLoc as GHC
import qualified GHC.Unit as GHC
import HIndent.Ast.NodeComments
import HIndent.Ast.WithComments
import qualified HIndent.GhcLibParserWrapper.GHC.Hs as GHC
import HIndent.Pretty
import HIndent.Pretty.Combinators
import HIndent.Pretty.NodeComments
#if MIN_VERSION_ghc_lib_parser(9, 6, 1)
data ExportEntry
= SingleIdentifier (GHC.LIEWrappedName GHC.GhcPs)
= SingleIdentifier (WithComments (GHC.IEWrappedName GHC.GhcPs))
| WithSpecificConstructors
(GHC.LIEWrappedName GHC.GhcPs)
[GHC.LIEWrappedName GHC.GhcPs]
| WithAllConstructors (GHC.LIEWrappedName GHC.GhcPs)
| ByModule (GHC.GenLocated GHC.SrcSpanAnnA GHC.ModuleName)
(WithComments (GHC.IEWrappedName GHC.GhcPs))
[WithComments (GHC.IEWrappedName GHC.GhcPs)]
| WithAllConstructors (WithComments (GHC.IEWrappedName GHC.GhcPs))
| ByModule (WithComments GHC.ModuleName)
#else
data ExportEntry
= SingleIdentifier (GHC.LIEWrappedName (GHC.IdP GHC.GhcPs))
= SingleIdentifier (WithComments (GHC.IEWrappedName (GHC.IdP GHC.GhcPs)))
| WithSpecificConstructors
(GHC.LIEWrappedName (GHC.IdP GHC.GhcPs))
[GHC.LIEWrappedName (GHC.IdP GHC.GhcPs)]
| WithAllConstructors (GHC.LIEWrappedName (GHC.IdP GHC.GhcPs))
| ByModule (GHC.GenLocated GHC.SrcSpanAnnA GHC.ModuleName)
(WithComments (GHC.IEWrappedName (GHC.IdP GHC.GhcPs)))
[WithComments (GHC.IEWrappedName (GHC.IdP GHC.GhcPs))]
| WithAllConstructors (WithComments (GHC.IEWrappedName (GHC.IdP GHC.GhcPs)))
| ByModule (WithComments GHC.ModuleName)
#endif
instance CommentExtraction ExportEntry where
nodeComments SingleIdentifier {} = NodeComments [] [] []
Expand All @@ -50,13 +50,16 @@ mkExportEntry (GHC.IEThingAll _ name _) = WithAllConstructors name
mkExportEntry (GHC.IEThingWith _ name _ constructors _) =
WithSpecificConstructors name constructors

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.10.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.10.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.6.4)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.6.4)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.10.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.10.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.6.4)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.6.4)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.10.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.10.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.6.4)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.6.4)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated

Check failure on line 51 in src/HIndent/Ast/Module/Export/Entry.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

• Couldn't match type: GHC.Types.SrcLoc.GenLocated
#else
mkExportEntry (GHC.IEVar _ name) = SingleIdentifier name
mkExportEntry (GHC.IEThingAbs _ name) = SingleIdentifier name
mkExportEntry (GHC.IEThingAll _ name) = WithAllConstructors name
mkExportEntry (GHC.IEVar _ name) = SingleIdentifier $ fromGenLocated name
mkExportEntry (GHC.IEThingAbs _ name) = SingleIdentifier $ fromGenLocated name
mkExportEntry (GHC.IEThingAll _ name) =
WithAllConstructors $ fromGenLocated name
mkExportEntry (GHC.IEThingWith _ name _ constructors) =
WithSpecificConstructors name constructors
WithSpecificConstructors
(fromGenLocated name)
(fmap fromGenLocated constructors)
#endif
mkExportEntry (GHC.IEModuleContents _ name) = ByModule name
mkExportEntry (GHC.IEModuleContents _ name) = ByModule $ fromGenLocated name
mkExportEntry GHC.IEGroup {} = neverAppears
mkExportEntry GHC.IEDoc {} = neverAppears
mkExportEntry GHC.IEDocNamed {} = neverAppears
Expand Down

0 comments on commit 957ba4f

Please sign in to comment.