File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed
ra_syntax/test_data/parser/inline/ok Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -415,6 +415,17 @@ pub(super) fn macro_call_after_excl(p: &mut Parser) -> BlockLike {
415
415
if p. at ( IDENT ) {
416
416
name ( p) ;
417
417
}
418
+ // Special-case `macro_rules! try`.
419
+ // This is a hack until we do proper edition support
420
+
421
+ // test try_macro_rules
422
+ // macro_rules! try { () => {} }
423
+ if p. at ( T ! [ try] ) {
424
+ let m = p. start ( ) ;
425
+ p. bump_remap ( IDENT ) ;
426
+ m. complete ( p, NAME ) ;
427
+ }
428
+
418
429
match p. current ( ) {
419
430
T ! [ '{' ] => {
420
431
token_tree ( p) ;
Original file line number Diff line number Diff line change
1
+ SOURCE_FILE@0..30
2
+ MACRO_CALL@0..29
3
+ PATH@0..11
4
+ PATH_SEGMENT@0..11
5
+ NAME_REF@0..11
6
+ IDENT@0..11 "macro_rules"
7
+ BANG@11..12 "!"
8
+ WHITESPACE@12..13 " "
9
+ NAME@13..16
10
+ IDENT@13..16 "try"
11
+ WHITESPACE@16..17 " "
12
+ TOKEN_TREE@17..29
13
+ L_CURLY@17..18 "{"
14
+ WHITESPACE@18..19 " "
15
+ TOKEN_TREE@19..21
16
+ L_PAREN@19..20 "("
17
+ R_PAREN@20..21 ")"
18
+ WHITESPACE@21..22 " "
19
+ EQ@22..23 "="
20
+ R_ANGLE@23..24 ">"
21
+ WHITESPACE@24..25 " "
22
+ TOKEN_TREE@25..27
23
+ L_CURLY@25..26 "{"
24
+ R_CURLY@26..27 "}"
25
+ WHITESPACE@27..28 " "
26
+ R_CURLY@28..29 "}"
27
+ WHITESPACE@29..30 "\n"
Original file line number Diff line number Diff line change
1
+ macro_rules! try { ( ) => { } }
You can’t perform that action at this time.
0 commit comments