File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ module GHC.Util.ApiAnnotation (
6
6
, GHC.Util.ApiAnnotation. comments
7
7
, isCommentMultiline
8
8
, isCommentPragma
9
+ , isCommentHaddock
9
10
, pragmas
10
11
, flags
11
12
, languagePragmas
@@ -67,6 +68,13 @@ isCommentPragma (L _ (EpaComment (EpaBlockComment comm) _)) =
67
68
" {-#" `isPrefixOf` comm && " #-}" `isSuffixOf` comm
68
69
isCommentPragma _ = False
69
70
71
+ isCommentHaddock :: LEpaComment -> Bool
72
+ isCommentHaddock (L _ (EpaComment (EpaBlockComment comm) _)) =
73
+ " {- |" `isPrefixOf` comm && " #-}" `isSuffixOf` comm
74
+ isCommentHaddock (L _ (EpaComment (EpaLineComment comm) _)) =
75
+ " -- |" `isPrefixOf` comm || " -- ^" `isPrefixOf` comm
76
+ isCommentHaddock _ = False
77
+
70
78
-- Pragmas have the form @{-# ...#-}@.
71
79
pragmas :: EpAnnComments -> [(LEpaComment , String )]
72
80
pragmas x =
You can’t perform that action at this time.
0 commit comments