language-c-comments-0.3: Extracting comments from C code

Safe HaskellNone

Language.C.Comments

Synopsis

Documentation

data Comment Source

Comment positions use Language.C.Data.Position for compatibility with Language.C.

Instances

Eq Comment 
Ord Comment

Comments are ordered by position within files.

Show Comment 

data CommentFormat Source

Comments can be either single- or multi-line style.

Constructors

SingleLine 
MultiLine 

commentPosition :: Comment -> PositionSource

The position of the comment within the source file.

commentText :: Comment -> StringSource

The text of a comment (including the comment marks).

commentTextWithoutMarks :: Comment -> StringSource

The text of a comment, but with the comment marks removed.

commentFormat :: Comment -> CommentFormatSource

The format of a comment (single- or multi-line).

comments :: FilePath -> IO [Comment]Source

Extract comments from a C file.

commentsFromString :: String -> [Comment]Source

Extract comments from a string. A comment's position contains a filename; this method uses the empty string in its place.