purescript-0.6.1.1: PureScript Programming Language Compiler

Safe HaskellSafe-Inferred
LanguageHaskell98

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 Char Source

Valid first characters for an identifier

identLetter :: Parsec String u Char Source

Valid identifier characters

opStart :: Parsec String u Char Source

Valid first characters for an operator

opLetter :: Parsec String u Char Source

Valid operators characters

langDef :: GenLanguageDef String u Identity Source

The PureScript language definition

tokenParser :: GenTokenParser String u Identity Source

A token parser based on the language definition

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

Parse a token

identifier :: Parsec String u String Source

Parse an identifier

identifierName :: Parsec String u String Source

Parse an identifier in a more permissive position

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

Parse a reserved word

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

Parse a reserved operator

operator :: Parsec String u String Source

Parse an operator

stringLiteral :: Parsec String u String Source

Parse a string literal

whiteSpace :: Parsec String u () Source

Parse whitespace

pipe :: Parsec String u Char Source

Pipe character

natural :: Parsec String u Integer Source

Natural number

properName :: Parsec String u ProperName Source

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 Ident Source

Parse an identifier or parenthesized operator

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

Parse a token inside square brackets

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

Parse a token inside parentheses

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

Parse a token inside braces

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

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 a Source

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 a Source

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 a Source

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 a Source

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 a Source

Run a parser which supports indentation