Provides additional methods to Try
via implicit conversion.
Provides additional methods to Try
via implicit conversion.
Consumes any kind of input, always succeeds.
Consumes any kind of input, always succeeds.
This parser would consume the entire input unless a max
constraint
is specified.
Consumes any number of consecutive characters that are not one of the specified characters.
Consumes any number of consecutive characters that are not one of the specified characters. Always succeeds unless a minimum number of required matches is specified.
Consumes any number of consecutive characters that are in one of the specified character ranges.
Consumes any number of consecutive characters that are in one of the specified character ranges. Always succeeds unless a minimum number of required matches is specified.
Consumes any number of consecutive occurrences of the specified characters.
Consumes any number of consecutive occurrences of the specified characters. Always succeeds unless a minimum number of required matches is specified.
Consumes any number of consecutive characters which satisfy the specified predicate.
Consumes any number of consecutive characters which satisfy the specified predicate. Always succeeds unless a minimum number of required matches is specified.
Succeeds at the start of the input.
Parses a blank line from the current input offset (which may not be at the start of the line).
Parses a blank line from the current input offset (which may not be at the start of the line). Fails for lines that contain any non-whitespace character. Does always produce an empty string as the result, discarding any whitespace characters found in the line.
Since it also succeeds at the end of the input
it should never be used in the form of (blankLine *)
or (blankLine +)
. Use
the blankLines
parser instead in these cases.
Parses one or more blanklines, producing a list of empty strings corresponding to the number of blank lines consumed.
A parser that matches only the specified character.
A parser that matches only the specified character.
The method is implicit so that characters can automatically be lifted to their parsers.
Implicit conversion that allows to pass a single
character to the range-based anyIn
parser.
A parser that succeeds if the specified parser succeeds and all input has been consumed.
A parser that succeeds if the specified parser succeeds and all input has been consumed.
Consumes any number of consecutive characters until the specified string delimiter is encountered on the input string.
Consumes any number of consecutive characters until the specified string delimiter is encountered on the input string.
Only succeeds if the specified postCondition
parser succeeds at the offset after
the consumed delimiter string.
Consumes any number of consecutive characters until the specified string delimiter is encountered on the input string.
Consumes any number of consecutive characters until one of the specified characters is encountered on the input string.
A parser function for the specified parser that is expected to consume all input and always succeed, throwing unexpected parser failures as exceptions instead.
A parser function for the specified parser that is expected to consume all input and always succeed, throwing unexpected parser failures as exceptions instead.
The docF
function turns the result of the parser into a document instance.
Succeeds at the end of the input.
Succeeds at the end of a line, including the end of the input.
Succeeds at the end of a line, including the end of the input. Produces an empty string as a result and consumes any new line characters.
A parser that always fails with the specified message.
A parser that always fails with the specified message.
A parser that matches only the specified literal string.
A parser that matches only the specified literal string.
The method is implicit so that strings can automatically be lifted to their parsers.
Applies the specified parser at the specified offset behind the current position.
Applies the specified parser at the specified offset behind the current position. Never consumes any input.
Applies the specified parser at the current position.
Applies the specified parser at the current position. Never consumes any input.
Applies the specified parser at the specified offset behind the current position.
Applies the specified parser at the specified offset behind the current position. Never consumes any input.
A parser that only succeeds if the specified parser fails and vice versa, it never consumes any input.
A parser that only succeeds if the specified parser fails and vice versa, it never consumes any input.
A parser for an optional element that always succeeds.
A parser for an optional element that always succeeds.
If the underlying parser succeeds this parser will contain its result as a Some
,
if it fails this parser will succeed with a None
.
Parses a simple reference name that only allows alphanumerical characters
and the punctuation characters -
, _
, .
, :
, +
.
Parses the rest of the line from the current input offset no matter whether it consist of whitespace only or some text.
Parses the rest of the line from the current input offset no matter whether it consist of whitespace only or some text. Does not include the eol character(s).
Parses a size and its amount, e.g.
Parses a size and its amount, e.g. 12px. The unit is mandatory and not validated.
A parser that always succeeds with the specified value.
A parser that always succeeds with the specified value.
Parses a single text line from the current input offset (which may not be at the start of the line).
Parses a single text line from the current input offset (which may not be at the start of the line). Fails for blank lines. Does not include the eol character(s).
A parser function for the specified parser that is expected to consume all input and always succeed, throwing unexpected parser failures as exceptions instead.
A parser function for the specified parser that is expected to consume all input and always succeed, throwing unexpected parser failures as exceptions instead.
Parses horizontal whitespace (space and tab).
Parses horizontal whitespace (space and tab). Always succeeds, consuming all whitespace found.
Parses any number of whitespace characters followed by a newline character.
Base text parsers that provide optimized low-level parsers for typical requirements of text markup parsers. In particular they are meant as an efficient replacement for scenarios where usually regex parsers are used. In cases where different parsers need to be tried for relatively short input sequences, regex parsers tend to be less efficient. Furthermore, these base parsers may also improve readability, as it allows to combine simple low-level parsers to higher-level parsers based on the Laika combinator API, instead of producing long regexes which may be hard to read.