Skip to content

Commit 84045e9

Browse files
paulstansifergraydon
authored andcommitted
---
yaml --- r: 35292 b: refs/heads/master c: e77491b h: refs/heads/master v: v3
1 parent b44de0d commit 84045e9

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: bd92499c5e65248b3dd2078e2f428f33004cba3d
2+
refs/heads/master: e77491bd870d9b026ebfbda07caab103f111ce8f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/src/libsyntax/parse/parser.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,6 +2380,25 @@ impl Parser {
23802380
}
23812381
}
23822382

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+
23832402
_ => { // All other kinds of statements:
23842403
stmts.push(stmt);
23852404

@@ -3567,6 +3586,10 @@ impl Parser {
35673586
// item macro.
35683587
let pth = self.parse_path_without_tps();
35693588
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.
35703593
let id = if self.token == token::LPAREN {
35713594
token::special_idents::invalid // no special identifier
35723595
} else {

0 commit comments

Comments
 (0)