Skip to content

Parametrize rules with arguments #12

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

Closed
ptal opened this issue Jul 7, 2014 · 2 comments
Closed

Parametrize rules with arguments #12

ptal opened this issue Jul 7, 2014 · 2 comments

Comments

@ptal
Copy link
Owner

ptal commented Jul 7, 2014

my_rule(s: &str) -> Expression
  = another_rule(s, res) ";" { Ok(Expression(s, res)) }

s is usable in the semantics action and can be passed to other rules.

@ptal
Copy link
Owner Author

ptal commented Jul 19, 2015

Instead of the another_rule(s, res) syntax, we might use ``(another_rule s res)` which is unambiguous. The backquote is used to say that the following expression is not a parser but a function that build a parser (meta-level).

@ptal
Copy link
Owner Author

ptal commented Jan 2, 2021

Triage: abandon this feature for now. Too complicated, and unsure if it is that useful.

@ptal ptal closed this as completed Jan 2, 2021
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