| Copyright | © 2018 Mark Karpov |
|---|---|
| License | BSD 3 clause |
| Maintainer | Mark Karpov <markkarpov92@gmail.com> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
GHC.SyntaxHighlighter
Description
Documentation
Token types that are used as tags to mark spans of source code.
Constructors
| KeywordTok | Keyword |
| PragmaTok | Pragmas |
| SymbolTok | Symbols (punctuation that is not an operator) |
| VariableTok | Variable name (term level) |
| ConstructorTok | Data/type constructor |
| OperatorTok | Operator |
| CharTok | Character |
| StringTok | String |
| IntegerTok | Integer |
| RationalTok | Rational number |
| CommentTok | Comment (including Haddocks) |
| SpaceTok | Space filling |
| OtherTok | Something else? |
tokenizeHaskell :: Text -> Maybe [(Token, Text)] Source #
Tokenize Haskell source code. If the code cannot be parsed, return
Nothing. Otherwise return the original input tagged by Tokens.
The parser does not require the input source code to form a valid Haskell
program, so as long as the lexer can decompose your input (most of the
time), it'll return something in Just.