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

Let grammars be defined in Rust's item positions (not only in functions) #23

Open
pczarn opened this issue May 21, 2016 · 1 comment
Open
Labels

Comments

@pczarn
Copy link
Owner

pczarn commented May 21, 2016

Allow top-level grammar definitions that can be used anywhere. For example,

grammar! MyGrammar {
    // ...
}

Then, parsers can be instantiated.

fn foo() {
    let parser = MyGrammar::new_parser();
    // ...
}

This won't work with stable syntax extensions, or at least with their first version.

@pczarn pczarn changed the title Let grammars be defined in item positions (not only in functions) Let grammars be defined in Rust's item positions (not only in functions) May 21, 2016
@pczarn pczarn added the E-easy label Jul 18, 2016
@pczarn
Copy link
Owner Author

pczarn commented Jul 20, 2016

I think grammars in item positions shouldn't be cut off from all variables. Their semantic actions should have access to common values akin to self-passing. To this end, Rust code including variable definitions could be mixed with grammar rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant