Safe Haskell | None |
---|---|
Language | Haskell2010 |
The first step in the parsing process - turns source code into a list of lexemes
- data PositionedToken = PositionedToken {
- ptSourcePos :: SourcePos
- ptEndPos :: SourcePos
- ptPrevEndPos :: Maybe SourcePos
- ptToken :: Token
- ptComments :: [Comment]
- data Token
- type TokenParser a = Parsec [PositionedToken] ParseState a
- lex :: FilePath -> Text -> Either ParseError [PositionedToken]
- lexLenient :: FilePath -> Text -> Either ParseError [PositionedToken]
- anyToken :: TokenParser PositionedToken
- token :: (Token -> Maybe a) -> TokenParser a
- match :: Token -> TokenParser ()
- lparen :: TokenParser ()
- rparen :: TokenParser ()
- parens :: TokenParser a -> TokenParser a
- lbrace :: TokenParser ()
- rbrace :: TokenParser ()
- braces :: TokenParser a -> TokenParser a
- lsquare :: TokenParser ()
- rsquare :: TokenParser ()
- squares :: TokenParser a -> TokenParser a
- indent :: TokenParser Int
- indentAt :: Column -> TokenParser ()
- larrow :: TokenParser ()
- rarrow :: TokenParser ()
- lfatArrow :: TokenParser ()
- rfatArrow :: TokenParser ()
- colon :: TokenParser ()
- doubleColon :: TokenParser ()
- equals :: TokenParser ()
- pipe :: TokenParser ()
- tick :: TokenParser ()
- dot :: TokenParser ()
- comma :: TokenParser ()
- semi :: TokenParser ()
- at :: TokenParser ()
- underscore :: TokenParser ()
- holeLit :: TokenParser Text
- semiSep :: TokenParser a -> TokenParser [a]
- semiSep1 :: TokenParser a -> TokenParser [a]
- commaSep :: TokenParser a -> TokenParser [a]
- commaSep1 :: TokenParser a -> TokenParser [a]
- lname :: TokenParser Text
- lname' :: Text -> TokenParser ()
- qualifier :: TokenParser Text
- tyname :: TokenParser Text
- kiname :: TokenParser Text
- dconsname :: TokenParser Text
- uname :: TokenParser Text
- uname' :: Text -> TokenParser ()
- mname :: TokenParser Text
- reserved :: Text -> TokenParser ()
- symbol :: TokenParser Text
- symbol' :: Text -> TokenParser ()
- identifier :: TokenParser Text
- charLiteral :: TokenParser Char
- stringLiteral :: TokenParser PSString
- number :: TokenParser (Either Integer Double)
- natural :: TokenParser Integer
- reservedPsNames :: [Text]
- reservedTypeNames :: [Text]
- isSymbolChar :: Char -> Bool
- isUnquotedKey :: Text -> Bool
Documentation
data PositionedToken Source #
PositionedToken | |
|
type TokenParser a = Parsec [PositionedToken] ParseState a Source #
lex :: FilePath -> Text -> Either ParseError [PositionedToken] Source #
lexLenient :: FilePath -> Text -> Either ParseError [PositionedToken] Source #
Lexes the given file, and on encountering a parse error, returns the progress made up to that point, instead of returning an error
match :: Token -> TokenParser () Source #
lparen :: TokenParser () Source #
rparen :: TokenParser () Source #
parens :: TokenParser a -> TokenParser a Source #
lbrace :: TokenParser () Source #
rbrace :: TokenParser () Source #
braces :: TokenParser a -> TokenParser a Source #
lsquare :: TokenParser () Source #
rsquare :: TokenParser () Source #
squares :: TokenParser a -> TokenParser a Source #
indent :: TokenParser Int Source #
indentAt :: Column -> TokenParser () Source #
larrow :: TokenParser () Source #
rarrow :: TokenParser () Source #
lfatArrow :: TokenParser () Source #
rfatArrow :: TokenParser () Source #
colon :: TokenParser () Source #
doubleColon :: TokenParser () Source #
equals :: TokenParser () Source #
pipe :: TokenParser () Source #
tick :: TokenParser () Source #
dot :: TokenParser () Source #
comma :: TokenParser () Source #
semi :: TokenParser () Source #
at :: TokenParser () Source #
underscore :: TokenParser () Source #
semiSep :: TokenParser a -> TokenParser [a] Source #
Parse zero or more values separated by semicolons
semiSep1 :: TokenParser a -> TokenParser [a] Source #
Parse one or more values separated by semicolons
commaSep :: TokenParser a -> TokenParser [a] Source #
Parse zero or more values separated by commas
commaSep1 :: TokenParser a -> TokenParser [a] Source #
Parse one or more values separated by commas
lname :: TokenParser Text Source #
lname' :: Text -> TokenParser () Source #
tyname :: TokenParser Text Source #
kiname :: TokenParser Text Source #
uname :: TokenParser Text Source #
uname' :: Text -> TokenParser () Source #
mname :: TokenParser Text Source #
reserved :: Text -> TokenParser () Source #
symbol :: TokenParser Text Source #
symbol' :: Text -> TokenParser () Source #
reservedPsNames :: [Text] Source #
A list of purescript reserved identifiers
reservedTypeNames :: [Text] Source #
isSymbolChar :: Char -> Bool Source #
The characters allowed for use in operators
isUnquotedKey :: Text -> Bool Source #
Strings allowed to be left unquoted in a record key