Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Token a = Token {}
- type Line = Int
- type Column = Int
- data Err
- = ReservedWordyId String
- | InvalidSymbolyId String
- | ReservedSymbolyId String
- | InvalidShortHash String
- | InvalidBytesLiteral String
- | InvalidHexLiteral
- | InvalidOctalLiteral
- | InvalidBinaryLiteral
- | Both Err Err
- | MissingFractional String
- | MissingExponent String
- | UnknownLexeme
- | TextLiteralMissingClosingQuote String
- | InvalidEscapeCharacter Char
- | LayoutError
- | CloseWithoutMatchingOpen String String
- | UnexpectedDelimiter String
- | UnexpectedTokens String
- data Pos = Pos {}
- data Lexeme
- lexer :: String -> String -> [Token Lexeme]
- preParse :: [Token Lexeme] -> BlockTree (Token Lexeme)
- escapeChars :: [(Char, Char)]
- debugFilePreParse :: FilePath -> IO ()
- debugPreParse :: BlockTree (Token Lexeme) -> String
- debugPreParse' :: String -> String
- showEscapeChar :: Char -> Maybe Char
- touches :: Token a -> Token b -> Bool
- typeOrTerm :: Monad m => ParsecT (Token Err) String m (ReferenceType, HashQualified Name)
- wordyIdChar :: Char -> Bool
- wordyIdStartChar :: Char -> Bool
- symbolyIdChar :: Char -> Bool
- formatTrivialError :: Set String -> Set String -> [Char]
- displayLexeme :: Lexeme -> String
Documentation
Instances
Open String | start of a block |
Semi IsVirtual | separator between elements of a block |
Close | end of a block |
Reserved String | reserved tokens such as `{`, `(`, `type`, `of`, etc |
Textual String | text literals, `"foo bar"` |
Character Char | character literals, `?X` |
WordyId (HashQualified Name) | a (non-infix) identifier. invariant: last segment is wordy |
SymbolyId (HashQualified Name) | an infix identifier. invariant: last segment is symboly |
Numeric String | numeric literals, left unparsed |
Bytes Bytes | bytes literals |
Hash ShortHash | hash literals |
Err Err | |
Doc (UntitledSection (Tree (Token (ReferenceType, HashQualified Name)) [Token Lexeme])) |
preParse :: [Token Lexeme] -> BlockTree (Token Lexeme) Source #
This turns the lexeme stream into a tree, reordering some lexeme subsequences.
escapeChars :: [(Char, Char)] Source #
debugFilePreParse :: FilePath -> IO () Source #
debugPreParse' :: String -> String Source #
Lexers
typeOrTerm :: Monad m => ParsecT (Token Err) String m (ReferenceType, HashQualified Name) Source #
Character classifiers
wordyIdChar :: Char -> Bool Source #
wordyIdStartChar :: Char -> Bool Source #
symbolyIdChar :: Char -> Bool Source #
Error formatting
displayLexeme :: Lexeme -> String Source #