Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Comment = Located ByteString
- parseComments :: Filename -> Language -> ByteString -> [Comment]
- readComments :: FilePath -> Maybe (IO [Comment])
- commentText :: Comment -> ByteString
- filename :: Located a -> Filename
- startLine :: Located a -> Int
- endLine :: Comment -> Int
- data Located a
- locatedValue :: Located a -> a
- newComment :: Filename -> Int -> ByteString -> Comment
- type Language = Lexer
- languageForFile :: FilePath -> Maybe Language
- highlightCode :: Language -> ByteString -> [Token]
Understand comments
type Comment = Located ByteString Source #
parseComments :: Filename -> Language -> ByteString -> [Comment] Source #
Given some source code, return a list of comments.
readComments :: FilePath -> Maybe (IO [Comment]) Source #
Read the given file, and parse out any comments.
Return Nothing if we cannot determine what language the file is in. Raises exceptions on bad IO, and also if the file cannot be decoded to Text.
commentText :: Comment -> ByteString Source #
Generic support for things located in files
A thing that is located somewhere in a text file.
locatedValue :: Located a -> a Source #
Exposed for testing
newComment :: Filename -> Int -> ByteString -> Comment Source #
Understand programming languages
Exposed for testing
highlightCode :: Language -> ByteString -> [Token] Source #