purescript-0.5.1: PureScript Programming Language Compiler

Safe HaskellSafe-Inferred

Language.PureScript.Parser.Common

Description

Constants, and utility functions to be used when parsing

Synopsis

Documentation

reservedPsNames :: [String]Source

A list of purescript reserved identifiers

opChars :: [Char]Source

The characters allowed for use in operators

reservedTypeNames :: [String]Source

A list of reserved identifiers for types

reservedOpNames :: [String]Source

A list of reserved operators

identStart :: Parsec String u CharSource

Valid first characters for an identifier

identLetter :: Parsec String u CharSource

Valid identifier characters

opStart :: Parsec String u CharSource

Valid first characters for an operator

opLetter :: Parsec String u CharSource

Valid operators characters

langDef :: GenLanguageDef String u IdentitySource

The PureScript language definition

tokenParser :: GenTokenParser String u IdentitySource

A token parser based on the language definition

lexeme :: Parsec String u a -> Parsec String u aSource

Parse a token

identifier :: Parsec String u StringSource

Parse an identifier

reserved :: String -> Parsec String u ()Source

Parse a reserved word

reservedOp :: String -> Parsec String u ()Source

Parse a reserved operator

operator :: Parsec String u StringSource

Parse an operator

stringLiteral :: Parsec String u StringSource

Parse a string literal

whiteSpace :: Parsec String u ()Source

Parse whitespace

pipe :: Parsec String u CharSource

Pipe character

natural :: Parsec String u IntegerSource

Natural number

properName :: Parsec String u ProperNameSource

Parse a proper name

parseQualified :: Parsec String ParseState a -> Parsec String ParseState (Qualified a)Source

Parse a qualified name, i.e. M.name or just name

integerOrFloat :: Parsec String u (Either Integer Double)Source

Parse an integer or floating point value

parseIdent :: Parsec String ParseState IdentSource

Parse an identifier or parenthesized operator

squares :: Parsec String ParseState a -> Parsec String ParseState aSource

Parse a token inside square brackets

parens :: Parsec String ParseState a -> Parsec String ParseState aSource

Parse a token inside parentheses

braces :: Parsec String ParseState a -> Parsec String ParseState aSource

Parse a token inside braces

angles :: Parsec String ParseState a -> Parsec String ParseState aSource

Parse a token inside angle brackets

sepBy :: Parsec String ParseState a -> Parsec String ParseState sep -> Parsec String ParseState [a]Source

Parse zero or more values separated by a separator token

sepBy1 :: Parsec String ParseState a -> Parsec String ParseState sep -> Parsec String ParseState [a]Source

Parse one or more values separated by a separator token

semiSep :: Parsec String ParseState a -> Parsec String ParseState [a]Source

Parse zero or more values separated by semicolons

semiSep1 :: Parsec String ParseState a -> Parsec String ParseState [a]Source

Parse one or more values separated by semicolons

commaSep :: Parsec String ParseState a -> Parsec String ParseState [a]Source

Parse zero or more values separated by commas

commaSep1 :: Parsec String ParseState a -> Parsec String ParseState [a]Source

Parse one or more values separated by commas

augment :: Stream s m t => ParsecT s u m a -> ParsecT s u m b -> (a -> b -> a) -> ParsecT s u m aSource

Run the first parser, then match the second if possible, applying the specified function on a successful match

fold :: Stream s m t => ParsecT s u m a -> ParsecT s u m b -> (a -> b -> a) -> ParsecT s u m aSource

Run the first parser, then match the second zero or more times, applying the specified function for each match

buildPostfixParser :: Stream s m t => [a -> ParsecT s u m a] -> ParsecT s u m a -> ParsecT s u m aSource

Build a parser from a smaller parser and a list of parsers for postfix operators

parseIdentInfix :: Parsec String ParseState (Qualified Ident)Source

Parse an identifier in backticks or an operator

mark :: Parsec String ParseState a -> Parsec String ParseState aSource

Mark the current indentation level

checkIndentation :: (Column -> Column -> Bool) -> Parsec String ParseState ()Source

Check that the current identation level matches a predicate

indented :: Parsec String ParseState ()Source

Check that the current indentation level is past the current mark

same :: Parsec String ParseState ()Source

Check that the current indentation level is at the same indentation as the current mark

runIndentParser :: FilePath -> Parsec String ParseState a -> String -> Either ParseError aSource

Run a parser which supports indentation