File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2380,6 +2380,25 @@ impl Parser {
2380
2380
}
2381
2381
}
2382
2382
2383
+ stmt_mac( m) => {
2384
+ // Statement macro; might be an expr
2385
+ match self . token {
2386
+ token:: SEMI => {
2387
+ self . bump( ) ;
2388
+ stmts. push( stmt) ;
2389
+ }
2390
+ token:: RBRACE => {
2391
+ // if a block ends in `m!(arg)` without
2392
+ // a `;`, it must be an expr
2393
+ expr = Some (
2394
+ self . mk_mac_expr( stmt. span. lo,
2395
+ stmt. span. hi,
2396
+ m. node) ) ;
2397
+ }
2398
+ _ => { stmts. push( stmt) ; }
2399
+ }
2400
+ }
2401
+
2383
2402
_ => { // All other kinds of statements:
2384
2403
stmts. push( stmt) ;
2385
2404
@@ -3567,6 +3586,10 @@ impl Parser {
3567
3586
// item macro.
3568
3587
let pth = self.parse_path_without_tps();
3569
3588
self.expect(token::NOT);
3589
+
3590
+ // a 'special' identifier (like what `macro_rules!` uses)
3591
+ // is optional. We should eventually unify invoc syntax
3592
+ // and remove this.
3570
3593
let id = if self.token == token::LPAREN {
3571
3594
token::special_idents::invalid // no special identifier
3572
3595
} else {
You can’t perform that action at this time.
0 commit comments