Exception thrown when parsing a text markup document or fragment fails.
Exception thrown when parsing a text markup document or fragment fails.
This can only happen due to a bug in this library, as the behaviour of the parser
is to treat all unknown or malformed markup as regular text and always succeed.
The result property holds the NoSuccess
instance that caused the failure.
Provides additional combinator methods to parsers via implicit conversion.
Provides additional combinator methods to parsers via implicit conversion.
API for specifying further constraints on the parsers provided by this base trait.
API for specifying further constraints on the parsers provided by this base trait.
For reading 3 or more '*'
or '+'
characters for example the constraint could
be specified as follows:
anyOf('*','+') min 3
Provides additional methods to Try
via implicit conversion.
Provides additional methods to Try
via implicit conversion.
Parses a single email address as defined in RFC 6068.
Parses a single email address as defined in RFC 6068.
addr-spec = local-part "@" domain
Parses letters according to RFC 2234.
Parses letters according to RFC 2234.
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
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 characters for which the specified parser fails on the corresponding offset.
Consumes any number of characters for which the specified parser fails on the corresponding offset.
This parser fails if the end of input is reached without the specified parser ever succeeding or
if the parser causes an Error result instead of a plain Failure or Success.
Further constraints like minimum or maximum number of required matching characters can be specified
through the API of the returned TextParser
instance.
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.
This parser is identical to the anyBut
parser except for two differences: this parser fails
if it reaches the end of the input without seeing any of the specified
characters and it also consumes this final character, without adding it
to the result. This parser is usually used when a construct like a span
enclosed between two characters needs to be parsed.
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.
Succeeds at the start of the input.
Parses the authority part of a URI as defined in RFC 3986.
Parses the authority part of a URI as defined in RFC 3986.
authority = [ userinfo "@" ] host [ ":" port ]
Implicit conversion that allows to pass a single
character to the range-based anyIn
parser.
Implicit conversion that allows to pass a single
character to the range-based anyIn
parser.
Parses digits according to RFC 2234.
Parses digits according to RFC 2234.
DIGIT = %x30-39; 0-9
Parses the domain portion of an email address as defined in RFC 6068.
Parses the domain portion of an email address as defined in RFC 6068.
domain = dot-atom-text / "[" *dtext-no-obs "]" dtext-no-obs = %d33-90 / ; Printable US-ASCII %d94-126 ; characters not including ; "[", "]", or "\"
Parses a dot-atom-text
sequence as defined in RFC 5322.
Parses a dot-atom-text
sequence as defined in RFC 5322.
dot-atom-text = 1*atext *("." 1*atext) atext = ALPHA / DIGIT / ; Printable US-ASCII "!" / "#" / ; characters not including "$" / "%" / ; specials. Used for atoms. "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~"
Parses a mailto URI without the scheme part as defined in RFC 6068.
Parses a full mailto URI as defined in RFC 6068.
Parses a full mailto URI as defined in RFC 6068.
mailtoURI = "mailto:" [ to ] [ hfields ]
Succeeds at the end of the input.
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.
Flattens the result from various combinators,
including the repX
variants and ~
into
a single string.
Parses the fragment part of a URI as defined in RFC 3986.
Parses the fragment part of a URI as defined in RFC 3986.
fragment = *( pchar / "/" / "?" )
Parses a hexadecimal value according to RFC 2234.
Parses a hexadecimal value according to RFC 2234.
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
Parses header fields of an email address as defined in RFC 6068.
Parses header fields of an email address as defined in RFC 6068.
hfields = "?" hfield *( "&" hfield ) hfield = hfname "=" hfvalue hfname = *qchar hfvalue = *qchar qchar = unreserved / pct-encoded / some-delims some-delims = "!" / "$" / "'" / "(" / ")" / "*" / "+" / "," / ";" / ":" / "@"
Parses the hierarchical part of a URI with an authority component as defined in RFC 3986, but only the variant including an authority component.
Parses the hierarchical part of a URI with an authority component as defined in RFC 3986, but only the variant including an authority component.
hier-part = "//" authority path-abempty
/ path-absolute ; excluded
/ path-rootless ; excluded
/ path-empty ; excluded
Parses a host as defined in RFC 3986.
Parses a host as defined in RFC 3986.
host = IP-literal / IPv4address / reg-name
Parses a full HTTP URI including the scheme part and an authority component as defined in RFC 3986.
Parses an HTTP or HTTPS URI with an authority component, but without the scheme part (therefore starting with "//") as defined in RFC 3986.
Parses an HTTP or HTTPS URI with an authority component, but without the scheme part (therefore starting with "//") as defined in RFC 3986.
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
Parses a full HTTPS URI including the scheme part and an authority component as defined in RFC 3986.
Parses an ip literal as defined in RFC 3986.
Parses an ip literal as defined in RFC 3986.
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
Parses an IPv4 address as defined in RFC 3986.
Parses an IPv4 address as defined in RFC 3986.
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet dec-octet = DIGIT ; 0-9 / %x31-39 DIGIT ; 10-99 / "1" 2DIGIT ; 100-199 / "2" %x30-34 DIGIT ; 200-249 / "25" %x30-35 ; 250-255
The implementation has been simplified to parse a 3-digit number and check its value.
Parses an IPv6 address as defined in RFC 3986.
Parses an IPv6 address as defined in RFC 3986.
IPv6address = 6( h16 ":" ) ls32 / "::" 5( h16 ":" ) ls32 / [ h16 ] "::" 4( h16 ":" ) ls32 / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 / [ *4( h16 ":" ) h16 ] "::" ls32 / [ *5( h16 ":" ) h16 ] "::" h16 / [ *6( h16 ":" ) h16 ] "::" h16 = 1*4HEXDIG ls32 = ( h16 ":" h16 ) / IPv4address
Parses a future IP address as defined in RFC 3986.
Parses a future IP address as defined in RFC 3986.
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
Parses the local part of an email address (before the @), with one deviation from RFC 6068: a quoted string is not allowed.
Parses the local part of an email address (before the @), with one deviation from RFC 6068: a quoted string is not allowed. It is rarely used, not supported by the reStructuredText reference parser and would be hard to combine within text markup as it allows for whitespace and line break characters.
local-part = dot-atom-text / quoted-string ; quoted-string omitted
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.
Returns an optimized, Array-based lookup function for the specified characters.
Returns an optimized, Array-based lookup function for the specified characters.
Returns an optimized, Array-based lookup function for the specified ranges of characters.
Returns an optimized, Array-based lookup function for the specified ranges of characters.
Parses one path character as defined in RFC 3986.
Parses one path character as defined in RFC 3986.
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
Fully parses the input from the specified reader and returns the result.
Fully parses the input from the specified reader and returns the result. This function is expected to always succeed, errors would be considered a bug in this library, as the parsers treat all unknown or malformed markup as regular text.
Fully parses the specified input string and returns the result.
Fully parses the specified input string and returns the result. This function is expected to always succeed, errors would be considered a bug in this library, as the parsers treat all unknown or malformed markup as regular text.
Parses the path of a URI as defined in RFC 3986, but only the path variant following an authority component.
Parses the path of a URI as defined in RFC 3986, but only the path variant following an authority component.
path-abempty = *( "/" segment )
segment = *pchar
Parses a percent-encoded character as defined in RFC 3986.
Parses a percent-encoded character as defined in RFC 3986.
pct-encoded = "%" HEXDIG HEXDIG
Parses a port as defined in RFC 3986, except for requiring at least one digit; instead the port is defined as optional in a higher level combinator.
Parses a port as defined in RFC 3986, except for requiring at least one digit; instead the port is defined as optional in a higher level combinator.
port = *DIGIT
Parses the query part of a URI as defined in RFC 3986.
Parses the query part of a URI as defined in RFC 3986.
query = *( pchar / "/" / "?" )
Parses a simple reference name that only allows alphanumerical characters
and the punctuation characters -
, _
, .
, :
, +
.
Parses a simple reference name that only allows alphanumerical characters
and the punctuation characters -
, _
, .
, :
, +
.
Parses a server name as defined in RFC 3986.
Parses a server name as defined in RFC 3986.
reg-name = *( unreserved / pct-encoded / sub-delims )
A parser generator for repetitions where all subsequent parsers after the first depend on the result of the previous.
A parser generator for repetitions where all subsequent parsers after the first depend on the result of the previous.
the parser to use for the first piece of input
a function that determines the next parser based on the result of the previous
(Changed in version 2.9.0) The p0
call-by-name arguments is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
Uses the parser for at most the specified number of repetitions, always succeeds.
Uses the parser for at most the specified number of repetitions, always succeeds. The result is the list of results from applying the parser repeatedly.
Uses the parser for at least the specified number of repetitions or otherwise fails.
Uses the parser for at least the specified number of repetitions or otherwise fails. Continues to apply the parser after the minimum has been reached until if fails. The result is the list of results from applying the parser repeatedly.
Parses a single sub-delimiter as defined in RFC 3986.
Parses a single sub-delimiter as defined in RFC 3986.
sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
Parses a sequence of email addresses as defined in RFC 6068.
Parses a sequence of email addresses as defined in RFC 6068.
to = addr-spec *("," addr-spec )
Parses a single unreserved character as defined in RFC 3986.
Parses a single unreserved character as defined in RFC 3986.
sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
Parses the user info portion of a URI as defined in RFC 3986.
Parses the user info portion of a URI as defined in RFC 3986.
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
Parses horizontal whitespace (space and tab).
Parses horizontal whitespace (space and tab). Always succeeds, consuming all whitespace found.
Parses URIs as defined in RFC 3986 and email addresses as defined in RFC 6068, 5322 and 3986 with base types defined in RFC 2234.