Special-case try macro_rules

This commit is contained in:
Edwin Cheng 2020-04-30 22:07:46 +08:00
parent fec1e7c8e1
commit 45c4f620b1
3 changed files with 39 additions and 0 deletions

View file

@ -415,6 +415,17 @@ pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike {
if p.at(IDENT) {
name(p);
}
// Special-case `macro_rules! try`.
// This is a hack until we do proper edition support
// test try_macro_rules
// macro_rules! try { () => {} }
if p.at(T![try]) {
let m = p.start();
p.bump_remap(IDENT);
m.complete(p, NAME);
}
match p.current() {
T!['{'] => {
token_tree(p);