Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
toku-sa-n committed Sep 7, 2024
1 parent dccc541 commit 46ea9d4
Showing 1 changed file with 61 additions and 42 deletions.
103 changes: 61 additions & 42 deletions src/HIndent/Pretty/NodeComments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -868,12 +868,15 @@ instance CommentExtraction (DataFamInstDecl GhcPs) where

instance CommentExtraction DataFamInstDecl' where
nodeComments DataFamInstDecl' {..} = nodeComments dataFamInstDecl
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)

instance CommentExtraction (PatSynBind GhcPs GhcPs) where
nodeComments PSB {..} = mconcat $ fmap nodeComments psb_ext
nodeComments = nodeCommentsPatSynBind

nodeCommentsPatSynBind :: PatSynBind GhcPs GhcPs -> NodeComments
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
nodeCommentsPatSynBind PSB {..} = mconcat $ fmap nodeComments psb_ext
#else
instance CommentExtraction (PatSynBind GhcPs GhcPs) where
nodeComments PSB {..} = nodeComments psb_ext
nodeCommentsPatSynBind PSB {..} = nodeComments psb_ext
#endif
-- | 'Pretty' for 'HsPatSynDetails'.
instance CommentExtraction
Expand Down Expand Up @@ -907,7 +910,7 @@ nodeCommentsInlineSpec Inline {} = emptyNodeComments
nodeCommentsInlineSpec Inlinable {} = emptyNodeComments
nodeCommentsInlineSpec NoInline {} = emptyNodeComments
nodeCommentsInlineSpec NoUserInlinePrag {} = emptyNodeComments
#if MIN_VERSION_ghc_lib_parser(9,4,1)
#if MIN_VERSION_ghc_lib_parser(9, 4, 1)
nodeCommentsInlineSpec Opaque {} = emptyNodeComments
#endif
instance CommentExtraction (HsPatSynDir GhcPs) where
Expand Down Expand Up @@ -943,16 +946,19 @@ instance CommentExtraction (HsLit GhcPs) where
nodeComments HsRat {} = emptyNodeComments
nodeComments HsFloatPrim {} = emptyNodeComments
nodeComments HsDoublePrim {} = emptyNodeComments
#if MIN_VERSION_ghc_lib_parser(9,6,1)

instance CommentExtraction (HsPragE GhcPs) where
nodeComments (HsPragSCC (x, _) _) = nodeComments x
nodeComments = nodeCommentsHsPragE

nodeCommentsHsPragE :: HsPragE GhcPs -> NodeComments
#if MIN_VERSION_ghc_lib_parser(9, 6, 1)
nodeCommentsHsPragE (HsPragSCC (x, _) _) = nodeComments x
#else
instance CommentExtraction (HsPragE GhcPs) where
nodeComments (HsPragSCC x _ _) = nodeComments x
nodeCommentsHsPragE (HsPragSCC x _) = nodeComments x

Check failure on line 957 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.0.2)

• The constructor ‘HsPragSCC’ should have 3 arguments, but has been given 2

Check failure on line 957 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 8.10.7)

• The constructor ‘HsPragSCC’ should have 3 arguments, but has been given 2

Check failure on line 957 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 8.10.7)

• The constructor ‘HsPragSCC’ should have 3 arguments, but has been given 2

Check failure on line 957 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.0.2)

• The constructor ‘HsPragSCC’ should have 3 arguments, but has been given 2

Check failure on line 957 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 8.10.7)

• The constructor ‘HsPragSCC’ should have 3 arguments, but has been given 2

Check failure on line 957 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.0.2)

• The constructor ‘HsPragSCC’ should have 3 arguments, but has been given 2
#endif
instance CommentExtraction HsIPName where
nodeComments HsIPName {} = emptyNodeComments
#if MIN_VERSION_ghc_lib_parser(9,6,1)
#if MIN_VERSION_ghc_lib_parser(9, 6, 1)
instance CommentExtraction (HsTyLit GhcPs) where
nodeComments HsNumTy {} = emptyNodeComments
nodeComments HsStrTy {} = emptyNodeComments
Expand All @@ -968,32 +974,38 @@ instance CommentExtraction (HsPatSigType GhcPs) where

instance CommentExtraction (HsIPBinds GhcPs) where
nodeComments IPBinds {} = emptyNodeComments
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)

instance CommentExtraction (IPBind GhcPs) where
nodeComments (IPBind x _ _) = mconcat $ fmap nodeComments x
nodeComments = nodeCommentsIPBind

nodeCommentsIPBind :: IPBind GhcPs -> NodeComments
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
nodeCommentsIPBind (IPBind x _ _) = mconcat $ fmap nodeComments x
#else
instance CommentExtraction (IPBind GhcPs) where
nodeComments (IPBind x _ _) = nodeComments x
nodeCommentsIPBind (IPBind x _ _) = nodeComments x
#endif
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
instance CommentExtraction (DerivStrategy GhcPs) where
nodeComments (StockStrategy x) = mconcat $ fmap nodeComments x
nodeComments (AnyclassStrategy x) = mconcat $ fmap nodeComments x
nodeComments (NewtypeStrategy x) = mconcat $ fmap nodeComments x
nodeComments (ViaStrategy x) = nodeComments x
nodeComments = nodeCommentsDerivStrategy

nodeCommentsDerivStrategy :: DerivStrategy GhcPs -> NodeComments
nodeCommentsDerivStrategy (ViaStrategy x) = nodeComments x
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
nodeCommentsDerivStrategy (StockStrategy x) = mconcat $ fmap nodeComments x
nodeCommentsDerivStrategy (AnyclassStrategy x) = mconcat $ fmap nodeComments x
nodeCommentsDerivStrategy (NewtypeStrategy x) = mconcat $ fmap nodeComments x
#else
instance CommentExtraction (DerivStrategy GhcPs) where
nodeComments (StockStrategy x) = nodeComments x
nodeComments (AnyclassStrategy x) = nodeComments x
nodeComments (NewtypeStrategy x) = nodeComments x
nodeComments (ViaStrategy x) = nodeComments x
nodeCommentsDerivStrategy (StockStrategy x) = nodeComments x
nodeCommentsDerivStrategy (AnyclassStrategy x) = nodeComments x
nodeCommentsDerivStrategy (NewtypeStrategy x) = nodeComments x
#endif
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
instance CommentExtraction XViaStrategyPs where
nodeComments (XViaStrategyPs x _) = mconcat $ fmap nodeComments x
nodeComments = nodeCommentsXViaStrategyPs

nodeCommentsXViaStrategyPs :: XViaStrategyPs -> NodeComments
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
nodeCommentsXViaStrategyPs (XViaStrategyPs x _) = mconcat $ fmap nodeComments x
#else
instance CommentExtraction XViaStrategyPs where
nodeComments (XViaStrategyPs x _) = nodeComments x
nodeCommentsXViaStrategyPs (XViaStrategyPs x _) = nodeComments x
#endif
instance CommentExtraction (RecordPatSynField GhcPs) where
nodeComments RecordPatSynField {} = emptyNodeComments
Expand Down Expand Up @@ -1046,14 +1058,17 @@ instance CommentExtraction DoExpression where

instance CommentExtraction LetIn where
nodeComments LetIn {} = emptyNodeComments
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)

instance CommentExtraction (RuleBndr GhcPs) where
nodeComments (RuleBndr x _) = mconcat $ fmap nodeComments x
nodeComments (RuleBndrSig x _ _) = mconcat $ fmap nodeComments x
nodeComments = nodeCommentsRuleBndr

nodeCommentsRuleBndr :: RuleBndr GhcPs -> NodeComments
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
nodeCommentsRuleBndr (RuleBndr x _) = mconcat $ fmap nodeComments x
nodeCommentsRuleBndr (RuleBndrSig x _ _) = mconcat $ fmap nodeComments x
#else
instance CommentExtraction (RuleBndr GhcPs) where
nodeComments (RuleBndr x _) = nodeComments x
nodeComments (RuleBndrSig x _ _) = nodeComments x
nodeCommentsRuleBndr (RuleBndr x _) = nodeComments x
nodeCommentsRuleBndr (RuleBndrSig x _ _) = nodeComments x
#endif
instance CommentExtraction CCallConv where
nodeComments = const emptyNodeComments
Expand All @@ -1079,17 +1094,21 @@ instance CommentExtraction FieldLabelString where
nodeComments = const emptyNodeComments
#endif

#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
instance CommentExtraction (HsUntypedSplice GhcPs) where
nodeComments (HsUntypedSpliceExpr x _) = mconcat $ fmap nodeComments x
nodeComments HsQuasiQuote {} = emptyNodeComments
#elif MIN_VERSION_ghc_lib_parser(9, 6, 1)
#if MIN_VERSION_ghc_lib_parser(9, 6, 1)
instance CommentExtraction (HsUntypedSplice GhcPs) where
nodeComments (HsUntypedSpliceExpr x _) = nodeComments x
nodeComments HsQuasiQuote {} = emptyNodeComments
nodeComments = nodeCommentsHsUntypedSplice

nodeCommentsHsUntypedSplice :: HsUntypedSplice GhcPs -> NodeComments
#if MIN_VERSION_ghc_lib_parser(9, 10, 1)
nodeCommentsHsUntypedSplice (HsUntypedSpliceExpr x _) =
mconcat $ fmap nodeComments x
#else
nodeCommentsHsUntypedSplice (HsUntypedSpliceExpr x) = nodeComments x

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

• The data constructor ‘HsUntypedSpliceExpr’ should have 2 arguments, but has been given 1

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.2.8)

• The constructor ‘HsUntypedSpliceExpr’ should have 2 arguments, but has been given 1

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.4.8)

• The constructor ‘HsUntypedSpliceExpr’ should have 2 arguments, but has been given 1

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

* The data constructor `HsUntypedSpliceExpr' should have 2 arguments, but has been given 1

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.4.8)

• The constructor ‘HsUntypedSpliceExpr’ should have 2 arguments, but has been given 1

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.2.8)

• The constructor ‘HsUntypedSpliceExpr’ should have 2 arguments, but has been given 1

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

• The data constructor ‘HsUntypedSpliceExpr’ should have 2 arguments, but has been given 1

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.2.8)

• The constructor ‘HsUntypedSpliceExpr’ should have 2 arguments, but has been given 1

Check failure on line 1106 in src/HIndent/Pretty/NodeComments.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.4.8)

• The constructor ‘HsUntypedSpliceExpr’ should have 2 arguments, but has been given 1
#endif
nodeCommentsHsUntypedSplice HsQuasiQuote {} = emptyNodeComments
#endif

#if MIN_VERSION_ghc_lib_parser(9,8,1)
#if MIN_VERSION_ghc_lib_parser(9, 8, 1)
instance CommentExtraction (LHsRecUpdFields GhcPs) where
nodeComments RegularRecUpdFields {} = emptyNodeComments
nodeComments OverloadedRecUpdFields {} = emptyNodeComments
Expand Down

0 comments on commit 46ea9d4

Please # to comment.