Skip to content

Commit 78e537a

Browse files
committed
---
yaml --- r: 56500 b: refs/heads/auto c: 7033901 h: refs/heads/master v: v3
1 parent 989e5e7 commit 78e537a

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 5119597dc6549e21d62ce7bae7b7418b3f8bf56e
17+
refs/heads/auto: 703390150a75abbe6fbacd6b6e3ae08c9a6f5e37
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libsyntax/parse/parser.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,14 +2359,13 @@ pub impl Parser {
23592359
}
23602360
_ => {
23612361
let mut args: ~[@pat] = ~[];
2362-
let mut star_pat = false;
23632362
match *self.token {
23642363
token::LPAREN => match self.look_ahead(1u) {
23652364
token::BINOP(token::STAR) => {
23662365
// This is a "top constructor only" pat
23672366
self.bump(); self.bump();
2368-
star_pat = true;
23692367
self.expect(&token::RPAREN);
2368+
pat = pat_enum(enum_path, None);
23702369
}
23712370
_ => {
23722371
args = self.parse_unspanned_seq(
@@ -2377,23 +2376,21 @@ pub impl Parser {
23772376
),
23782377
|p| p.parse_pat(refutable)
23792378
);
2379+
pat = pat_enum(enum_path, Some(args));
23802380
}
23812381
},
2382-
_ => ()
2383-
}
2384-
// at this point, we're not sure whether it's a
2385-
// enum or a bind
2386-
if star_pat {
2387-
pat = pat_enum(enum_path, None);
2388-
}
2389-
else if vec::is_empty(args) &&
2390-
vec::len(enum_path.idents) == 1u {
2391-
pat = pat_ident(binding_mode,
2392-
enum_path,
2393-
None);
2394-
}
2395-
else {
2396-
pat = pat_enum(enum_path, Some(args));
2382+
_ => {
2383+
if vec::len(enum_path.idents)==1u {
2384+
// it could still be either an enum
2385+
// or an identifier pattern, resolve
2386+
// will sort it out:
2387+
pat = pat_ident(binding_mode,
2388+
enum_path,
2389+
None);
2390+
} else {
2391+
pat = pat_enum(enum_path, Some(args));
2392+
}
2393+
}
23972394
}
23982395
}
23992396
}

0 commit comments

Comments
 (0)