File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
trunk/src/libsyntax/parse Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: bd92499c5e65248b3dd2078e2f428f33004cba3d
2
+ refs/heads/master: e77491bd870d9b026ebfbda07caab103f111ce8f
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
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