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

Add macro 2.0 support in parser #2628

Merged
merged 2 commits into from
Dec 21, 2019
Merged

Conversation

edwin0cheng
Copy link
Member

@edwin0cheng edwin0cheng commented Dec 21, 2019

This PR added a new syntax kind : MACRO_DEF and a keyword MACRO_KW

there are two syntax for declarative macro 2.0 :

  1. Normal : macro m { ($i:ident) => {} } , which handle similar to legacy one.
  2. Call like: macro m($i:ident) {}, it produces a single token tree which have two child token trees : ($i:ident) and {}

@edwin0cheng
Copy link
Member Author

bors r=matklad

bors bot added a commit that referenced this pull request Dec 21, 2019
2628: Add macro 2.0 support in parser r=matklad a=edwin0cheng

This PR added a new syntax kind : `MACRO_DEF` and a keyword `MACRO_KW`

there are two syntax for declarative macro 2.0 :
1. Normal : `macro m { ($i:ident) => {} }` , which handle similar to legacy one. 
2. Call like: `macro m($i:ident) {}`, it produces a single token tree which have two child token trees : `($i:ident)` and `{}`

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
@bors
Copy link
Contributor

bors bot commented Dec 21, 2019

Build succeeded

  • Rust
  • TypeScript

@bors bors bot merged commit 4195c0e into rust-lang:master Dec 21, 2019
@edwin0cheng edwin0cheng deleted the parse-macro-2 branch December 21, 2019 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants