parser_combs v0.1.0 Parser.Combinators View Source
This module provides basic combinators
Link to this section Summary
Functions
accepts a number n and a parser p which produces a parser np. The parser succeeds if parser p can be successfully applied at least n times.
accepts a range m..n and a parser p. Produces a parser pr which succeeds if parser p can be applied at least n times.
same as &between/2 excepts it accepts a minimum and a maximum value separately instead of a range.
accepts a number n and a parser p and returns parser np. Parser np succeeds only if parser p is successfully applied n times.
accepts a parser and applies it to the input string until that parser fails. Returns a list of parser results. The parser still succeeds even if the result list is empty.
accepts a parser p and produces a parser that will always succeed. Produces either an empty list or a single element list.
accepts a testing function and produces a parser. The parser succeeds if the element picked from the input string and applied to the testing function returns true.
accepts a parser and applies it to the input string until that parser fails. Returns a list of parser results. The parser succeeds if the at least one result is produced.
accepts a number n and a parser p. Produces a parser np. Parser np applies parser p up to n times. Parser np will always succeed even if parser p cannot be applied even once. Returns a list of parser p results which may be empty.
same as up_to/2, but parser p has to succeed at least once
Link to this section Functions
accepts a number n and a parser p which produces a parser np. The parser succeeds if parser p can be successfully applied at least n times.
accepts a range m..n and a parser p. Produces a parser pr which succeeds if parser p can be applied at least n times.
same as &between/2 excepts it accepts a minimum and a maximum value separately instead of a range.
accepts a number n and a parser p and returns parser np. Parser np succeeds only if parser p is successfully applied n times.
accepts a parser and applies it to the input string until that parser fails. Returns a list of parser results. The parser still succeeds even if the result list is empty.
accepts a parser p and produces a parser that will always succeed. Produces either an empty list or a single element list.
accepts a testing function and produces a parser. The parser succeeds if the element picked from the input string and applied to the testing function returns true.
accepts a parser and applies it to the input string until that parser fails. Returns a list of parser results. The parser succeeds if the at least one result is produced.
accepts a number n and a parser p. Produces a parser np. Parser np applies parser p up to n times. Parser np will always succeed even if parser p cannot be applied even once. Returns a list of parser p results which may be empty.
same as up_to/2, but parser p has to succeed at least once