Skip to content

Replace the ast::Mac_ enum with a struct #28527

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
Manishearth opened this issue Sep 20, 2015 · 3 comments
Closed

Replace the ast::Mac_ enum with a struct #28527

Manishearth opened this issue Sep 20, 2015 · 3 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@Manishearth
Copy link
Member

https://github.com/rust-lang/rust/blob/master/src/libsyntax/ast.rs#L1137

pub enum Mac_ {
    MacInvocTT(Path, Vec<TokenTree>, SyntaxContext),   // new macro-invocation
}

this should instead be something like

pub struct MacroInvoke {
    path: Path,
    tts: Vec<TokenTree>,
    context: SyntaxContext,
}

We'd need to update all type and other errors.

I'm willing to mentor this.

Please leave a comment if you're working on this and let me know if you need any help.

@Manishearth Manishearth added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. A-refactor labels Sep 20, 2015
@apasel422
Copy link
Contributor

I'm working on this.

@Manishearth
Copy link
Member Author

Awesome!

@Manishearth
Copy link
Member Author

Note: You may want to base it on top of #28526, and convert the complicated "and_then + destructuring match" to a simpler "move MacroInvoke out of P<T> via and_then and then use fields throughout the function"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

2 participants