Skip to content

Commit 335b4ac

Browse files
paulstansifergraydon
authored andcommitted
---
yaml --- r: 36485 b: refs/heads/try2 c: e77491b h: refs/heads/master i: 36483: c7ec533 v: v3
1 parent 5321df1 commit 335b4ac

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: bd92499c5e65248b3dd2078e2f428f33004cba3d
8+
refs/heads/try2: e77491bd870d9b026ebfbda07caab103f111ce8f
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/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)