Ok
Value members
Inherited methods
Sets this parser's label.
Sets this parser's label.
Note that this only happens on non-consuming parsers: if the parser consumed data, then he's not one the possible outcomes of a disjunction, but the right branch of the disjunction. It just happened to fail.
Take for example:
val parser = string("foo") | string("bar")
parser.run("foa")
In this context, bar
is clearly not a possibility - we've started parsing foo
succesfully, and we want a
message like "Expected o, found a". Applying the label to a consuming result would, instead, yield "Expected foo,
found a", which is less useful.
- Inherited from:
- Result