Skip to content
New issue

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

Use special object instead of null #182

Closed
Mingun opened this issue Jun 18, 2013 · 2 comments
Closed

Use special object instead of null #182

Mingun opened this issue Jun 18, 2013 · 2 comments

Comments

@Mingun
Copy link
Contributor

Mingun commented Jun 18, 2013

Why not use some singleton internal object as result of parsing instead of null for indicate match failures? Then in actions you free return any value (including null).

@otac0n
Copy link

otac0n commented Jul 3, 2013

Or a wrapper type. In Pegasus, I used a type called ParseResult. It has a property, value which can be null, but you can also return a null parse result to indicate parse failure. Then, labeled expressions and repetitions simply unwrap the value.

@dmajda
Copy link
Contributor

dmajda commented Jan 18, 2014

Resolved by fixing #198.

@dmajda dmajda closed this as completed Jan 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants