Creates an appender given the first item to be added This is used to build the result in Parser.repAs
Creates an appender This is used to build the result in Parser.repAs0
A limited Builder-like value we use for portability
This is a pointer to a zero based line, column, and total offset.
This is a class to convert linear offset in a string into lines, or the column and line numbers.
Parser[A] is a Parser0[A] that will always consume one-or-more characters on a successful parse.
Parser[A] is a Parser0[A] that will always consume one-or-more characters on a successful parse.
Since Parser is guaranteed to consume input it provides additional methods which would be unsafe
when used on parsers that succeed without consuming input, such as rep0
.
When a Parser is composed with a Parser0 the result is usually a Parser. Parser overrides many
of Parser0's methods to refine the return type. In other cases, callers may need to use the
with1
helper method to refine the type of their expressions.
Parser doesn't provide any additional guarantees over Parser0 on what kind of parsing failures it can return.
Parser0[A] attempts to extract an A
value from the given input, potentially moving its offset
forward in the process.
Parser0[A] attempts to extract an A
value from the given input, potentially moving its offset
forward in the process.
When calling parse
, one of three outcomes occurs:
Operations such as x.orElse(y)
will only consider parser y
if x
returns an epsilon
failure; these methods cannot recover from an arresting failure. Arresting failures can be
"rewound" using methods such as x.backtrack
(which converts arresting failures from x
into
epsilon failures), or softProduct(x, y)
(which can rewind successful parses by x
that are
followed by epsilon failures for y
).
Rewinding tends to make error reporting more difficult and can lead to exponential parser behavior it is not the default behavior.
Parsers for the common rules of RFC5234.
Parsers for the common rules of RFC5234. These rules are referenced by several RFCs.
SemVer 2.0.0 Parser based on https://semver.org
This is a class to convert linear offset in a string into lines, or the column and line numbers.
This is useful for display to humans who in text editors think in terms of line and column numbers