]> git.lizzy.rs Git - rust.git/commit
Merge #2628
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sat, 21 Dec 2019 10:47:47 +0000 (10:47 +0000)
committerGitHub <noreply@github.com>
Sat, 21 Dec 2019 10:47:47 +0000 (10:47 +0000)
commit90ef070db3dce0a7acb9cd11d0b0d72de13c9d79
treec6fcc8c77fe4948b356e397fb5fe1f8e8ac39037
parent3ebf15c9b29b1fed6319d04f540ad48cd4bd6995
parent4195c0e5f9a3db7646d4df28aa8c77a863c35759
Merge #2628

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>