Module
StringParser.Combinators
- Package
- purescript-string-parsers
- Repository
- purescript-contrib/purescript-string-parsers
This module defines combinators for building string parsers.
#many1 Source
many1 :: forall a. Parser a -> Parser (NonEmptyList a)
Match a parser one or more times. Stops matching when the parser fails or does not consume anymore.
#many1Till Source
many1Till :: forall a end. Parser a -> Parser end -> Parser (NonEmptyList a)
Match a parser until a terminator parser matches, requiring at least one match. Fails when the parser does not consume anymore.
#assertConsume Source
assertConsume :: forall a. Parser a -> Parser a
Run given parser and fail if the parser did not consume any input.
#(<?>) Source
Operator alias for StringParser.Combinators.withError (left-associative / precedence 4)
#optionMaybe Source
optionMaybe :: forall a. Parser a -> Parser (Maybe a)
Attempt to parse a value, pureing Nothing
in case of failure.
#sepBy1 Source
sepBy1 :: forall a sep. Parser a -> Parser sep -> Parser (NonEmptyList a)
Parse one or more separated values.
#sepEndBy1 Source
sepEndBy1 :: forall a sep. Parser a -> Parser sep -> Parser (NonEmptyList a)
Parse one or more separated values, optionally ending with a separator.
#endBy1 Source
endBy1 :: forall a sep. Parser a -> Parser sep -> Parser (NonEmptyList a)
Parse one or more separated values, ending with a separator.