@@ -34,14 +34,18 @@ directives = words $
34
34
" CONLIKE LINE SPECIALIZE SPECIALISE UNPACK NOUNPACK SOURCE"
35
35
36
36
data Comments = Comments
37
- { commBlocks :: ! [LEpaComment ]
37
+ { commPragma :: ! [LEpaComment ]
38
+ , commBlocks :: ! [LEpaComment ]
39
+ -- TODO: Process the different types of block comments; [" |",""].
40
+ -- * Haddock comments
41
+ -- * Simple comments
38
42
, commRuns :: ! [[LEpaComment ]]
39
43
, commLines :: ! [LEpaComment ]
40
44
}
41
45
42
46
classifyComments :: [LEpaComment ] -> Comments
43
- classifyComments xs = Comments blocks runs lines where
44
- (blocks, singles) = partition isCommentMultiline xs
47
+ classifyComments xs = Comments pragmas blocks runs lines where
48
+ (partition isCommentPragma -> (pragmas, blocks) , singles) = partition isCommentMultiline xs
45
49
(concat -> lines , runs) = partition ((== 1 ) . length ) $ commentRuns singles
46
50
47
51
commentRuns :: [LEpaComment ] -> [[LEpaComment ]]
@@ -109,6 +113,7 @@ commentHint _ m =
109
113
-- b) runs of single-line comments
110
114
-- c) single-line comments
111
115
-- TODO: Remove (True, _) runs and then run the other checks on the rest.
116
+ traceShow (" pragmas" , commentText <$> pragmas) $
112
117
traceShow (" blocks" , commentText <$> blocks) $
113
118
traceShow (" runs" , fmap commentText <$> rawRuns) $
114
119
traceShow (" lines" , commentText <$> lines ) $
@@ -125,7 +130,7 @@ commentHint _ m =
125
130
singleLines = sort $ commentLine <$> filter isSingle comments
126
131
someLines = sort $ commentLine <$> filter isSingleSome comments
127
132
128
- Comments blocks rawRuns lines = classifyComments comments
133
+ Comments pragmas blocks rawRuns lines = classifyComments comments
129
134
130
135
runs = dropBlankLinesHint <$> rawRuns
131
136
0 commit comments