Parser<a> or(Parser<a> x, Parser<a> y)
Arguments
x: The first parsery: The second parser
Usage
Create a new parser combining x and y. The new parser recognises a string which is recognised by either x or y.
decimal = or(Parse::digit,Parse::char@('.'));
// may be more clear in many situations to write this as
decimal = Parse::digit `or` Parse::char@('.');
As with Kaya's || operator, this uses short-circuit evaluation: if x parses the String successfully, y will not be used.