Skip to content

Commit f3e5828

Browse files
committed
---
yaml --- r: 13156 b: refs/heads/master c: f394933 h: refs/heads/master v: v3
1 parent 2258c27 commit f3e5828

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-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: abef5f54c99ab8a6a1ea73c9b946557c13caf719
2+
refs/heads/master: f394933641b5894a4c408aaae59ea3f632b3ee64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libsyntax/parse/parser.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,12 @@ class parser {
724724
let mut fields = [self.parse_field(token::COLON)];
725725
let mut base = none;
726726
while self.token != token::RBRACE {
727+
// optional comma before "with"
728+
if self.token == token::COMMA
729+
&& self.token_is_keyword("with",
730+
self.look_ahead(1u)) {
731+
self.bump();
732+
}
727733
if self.eat_keyword("with") {
728734
base = some(self.parse_expr()); break;
729735
}

trunk/src/test/run-pass/issue-2463.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
fn main() {
2+
3+
let x = {
4+
f: 0,
5+
g: 0,
6+
};
7+
8+
let y = {
9+
f: 1,
10+
g: 1,
11+
with x
12+
};
13+
14+
let z = {
15+
f: 1,
16+
with x
17+
};
18+
19+
}

0 commit comments

Comments
 (0)