We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create an Else parser that is invoked when the previous one is not matched. Identical to Then but with the opposite trigger.
Else
Then
Can be used to return an object as a fallback (or default value).
Example:
var p = a.Or(b).Else(() => new DefaultValue()); // if neither a or b were parsed
Note this might be doable with ZeroOrOne and then check if the results is set
ZeroOrOne
The text was updated successfully, but these errors were encountered:
ZeroOrOne(a.Or(b)).Then(x => x ?? new DefaultValue());
Sorry, something went wrong.
bc9680c
No branches or pull requests
Create an
Else
parser that is invoked when the previous one is not matched. Identical toThen
but with the opposite trigger.Can be used to return an object as a fallback (or default value).
Example:
Note this might be doable with
ZeroOrOne
and then check if the results is setThe text was updated successfully, but these errors were encountered: