@@ -2046,8 +2046,6 @@ impl Parser {
2046
2046
pat = self.parse_pat_ident(refutable, bind_by_value);
2047
2047
} else if self.eat_keyword(~" move") {
2048
2048
pat = self.parse_pat_ident(refutable, bind_by_move);
2049
- } else if !is_plain_ident(self.token) {
2050
- pat = self.parse_enum_variant(refutable);
2051
2049
} else {
2052
2050
let binding_mode;
2053
2051
// XXX: Aren't these two cases deadcode? -- bblum
@@ -2066,7 +2064,7 @@ impl Parser {
2066
2064
let cannot_be_enum_or_struct;
2067
2065
match self.look_ahead(1) {
2068
2066
token::LPAREN | token::LBRACKET | token::LT |
2069
- token::LBRACE =>
2067
+ token::LBRACE | token::MOD_SEP =>
2070
2068
cannot_be_enum_or_struct = false,
2071
2069
_ =>
2072
2070
cannot_be_enum_or_struct = true
@@ -2163,32 +2161,6 @@ impl Parser {
2163
2161
pat_ident(binding_mode, name, sub)
2164
2162
}
2165
2163
2166
- fn parse_enum_variant(refutable: bool) -> ast::pat_ {
2167
- let enum_path = self.parse_path_with_tps(true);
2168
- match self.token {
2169
- token::LPAREN => {
2170
- match self.look_ahead(1u) {
2171
- token::BINOP(token::STAR) => { // foo(*)
2172
- self.expect(token::LPAREN);
2173
- self.expect(token::BINOP(token::STAR));
2174
- self.expect(token::RPAREN);
2175
- pat_enum(enum_path, None)
2176
- }
2177
- _ => { // foo(a, ..., z)
2178
- let args = self.parse_unspanned_seq(
2179
- token::LPAREN, token::RPAREN,
2180
- seq_sep_trailing_disallowed(token::COMMA),
2181
- |p| p.parse_pat(refutable));
2182
- pat_enum(enum_path, Some(args))
2183
- }
2184
- }
2185
- }
2186
- _ => { // option::None
2187
- pat_enum(enum_path, Some(~[]))
2188
- }
2189
- }
2190
- }
2191
-
2192
2164
fn parse_local(is_mutbl: bool,
2193
2165
allow_init: bool) -> @local {
2194
2166
let lo = self.span.lo;
0 commit comments