r.* applies r zero or more times and returns a list of the results.
r.+ applies r one or more times and returns a list of the results.
lhs <~ rhs applies lhs followed by rhs and returns the result of lhs.
r.? optionally matches r, producing Some(res) as the result if r succeeds with the result res
or None if r fails.
Applies f to the result of this rule if this rule is matched successfully and
yields the result of f as the result of the rule.
Applies f to the result of this rule if this rule is matched successfully and
yields the result of f as the result of the rule.
This is also known as the Japanese Smiley Operator.
Applies f to the result of this rule and the location of the match if this rule
is matched successfully and yields the result of f as the result of the rule.
If this rule matches, return a successful result containing the given, lazily evaluated, expression.
Applies f to the location of the match if this rule is matched successfully and yields
the result of f as the result of the rule.
Pretend we're parsing a token stream that contains just this one token.
Pretend we're parsing a token stream that contains just this one token. We use this to check whether the alternative could've matched the current token (or an expansion of the current token) as well, when the left side of a | already matched (and we therefore do not want to advance the token stream any further)
lhs | rhs first tries to apply the rule lhs.
lhs | rhs first tries to apply the rule lhs. If this fails *without consuming any tokens*,
rhs is applied instead. This is successful if lhs or rhs were applied successfully,
otherwise it's a failure. In case of a success the result value will be that of the rule that
was successfully applied.
lhs ~ rhs applies lhs followed by rhs (if lhs was successful).
lhs ~ rhs applies lhs followed by rhs (if lhs was successful). The result
will be a tuple containing the results of both lhs and rhs.
lhs ~> rhs applies lhs followed by rhs and returns the result of rhs.
lhs ~^ (r => rhs(r)) applies lhs followed by rhs(r) (if lhs was successful,
rhs(r)r is the result of lhs). The final result will be the result of .