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

Null parser #39

Closed
robrix opened this issue Dec 16, 2014 · 2 comments
Closed

Null parser #39

robrix opened this issue Dec 16, 2014 · 2 comments

Comments

@robrix
Copy link
Owner

robrix commented Dec 16, 2014

Parses everywhere but doesn’t actually produce any trees or advance the input at all.

let null: Parser<()>.Function = { ((), $0) }

This is the same as ε. It could be a workaround for/alternative to #38 in that since it produces () trees, alternation with T will produce T?:

(x | null) --> { $0.map(const("x matched")) ?? "x did not match" }
@robrix
Copy link
Owner Author

robrix commented Feb 23, 2015

This would produce Ignore now.

@robrix
Copy link
Owner Author

robrix commented May 15, 2015

This exists, it’s none.

@robrix robrix closed this as completed May 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant