purescript-0.8.5.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.Parser.Common

Description

Constants, and utility functions to be used when parsing

Synopsis

Documentation

moduleName :: TokenParser ModuleName Source

Parse a module name

parseQualified :: TokenParser a -> TokenParser (Qualified a) Source

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

parseIdent :: TokenParser Ident Source

Parse an identifier or parenthesized operator

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

mark :: Parsec s ParseState a -> Parsec s ParseState a Source

Mark the current indentation level

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

Check that the current identation level matches a predicate

indented :: Parsec s ParseState () Source

Check that the current indentation level is past the current mark

same :: Parsec s ParseState () Source

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

readComments :: Parsec [PositionedToken] u [Comment] Source

Read the comments from the the next token, without consuming it