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

Parametrize rules with arguments #12

Open
ptal opened this Issue Jul 7, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@ptal
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

This comment has been minimized.

Show comment
Hide comment
@ptal

ptal Jul 19, 2015

Owner

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).

Owner

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment