File tree 1 file changed +11
-12
lines changed
crates/parser/src/grammar
1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -70,16 +70,9 @@ pub(super) fn item_or_macro(p: &mut Parser<'_>, stop_on_r_curly: bool) {
70
70
// macro_rules! {};
71
71
// macro_rules! ()
72
72
// macro_rules! []
73
- if paths:: is_use_path_start ( p)
74
- || ( p. at_contextual_kw ( T ! [ macro_rules] ) && p. nth_at ( 1 , BANG ) && !p. nth_at ( 2 , IDENT ) )
75
- {
76
- match macro_call ( p) {
77
- BlockLike :: Block => ( ) ,
78
- BlockLike :: NotBlock => {
79
- p. expect ( T ! [ ; ] ) ;
80
- }
81
- }
82
- m. complete ( p, MACRO_CALL ) ;
73
+ let no_ident = p. at_contextual_kw ( T ! [ macro_rules] ) && p. nth_at ( 1 , BANG ) && !p. nth_at ( 2 , IDENT ) ;
74
+ if paths:: is_use_path_start ( p) || no_ident {
75
+ macro_call ( p, m) ;
83
76
return ;
84
77
}
85
78
@@ -436,10 +429,16 @@ fn fn_(p: &mut Parser<'_>, m: Marker) {
436
429
m. complete ( p, FN ) ;
437
430
}
438
431
439
- fn macro_call ( p : & mut Parser < ' _ > ) -> BlockLike {
432
+ fn macro_call ( p : & mut Parser < ' _ > , m : Marker ) {
440
433
assert ! ( paths:: is_use_path_start( p) ) ;
441
434
paths:: use_path ( p) ;
442
- macro_call_after_excl ( p)
435
+ match macro_call_after_excl ( p) {
436
+ BlockLike :: Block => ( ) ,
437
+ BlockLike :: NotBlock => {
438
+ p. expect ( T ! [ ; ] ) ;
439
+ }
440
+ }
441
+ m. complete ( p, MACRO_CALL ) ;
443
442
}
444
443
445
444
pub ( super ) fn macro_call_after_excl ( p : & mut Parser < ' _ > ) -> BlockLike {
You can’t perform that action at this time.
0 commit comments