diff options
| author | Luqman Aden <laden@csclub.uwaterloo.ca> | 2013-10-22 23:44:55 -0400 |
|---|---|---|
| committer | Luqman Aden <laden@csclub.uwaterloo.ca> | 2013-10-25 01:21:07 -0400 |
| commit | 99b7662971e97cf53669b2f5620dcd9ff8b98bc3 (patch) | |
| tree | 7ad10bc71c7eb116dd7316b11f9e24d6fd30ba7d /src/libsyntax/parse | |
| parent | 12308db3d23fe59b7ccfed6c535896ac6fdb5abe (diff) | |
| download | rust-99b7662971e97cf53669b2f5620dcd9ff8b98bc3.tar.gz rust-99b7662971e97cf53669b2f5620dcd9ff8b98bc3.zip | |
libsyntax: Get rid of some logic for some obsolete syntax.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d78c6189212..5a5e310e56f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1184,15 +1184,7 @@ impl Parser { pub fn is_named_argument(&self) -> bool { let offset = match *self.token { token::BINOP(token::AND) => 1, - token::BINOP(token::MINUS) => 1, token::ANDAND => 1, - token::BINOP(token::PLUS) => { - if self.look_ahead(1, |t| *t == token::BINOP(token::PLUS)) { - 2 - } else { - 1 - } - }, _ if token::is_keyword(keywords::Mut, self.token) => 1, _ => 0 }; @@ -1802,7 +1794,7 @@ impl Parser { return self.mk_mac_expr(lo, hi, mac_invoc_tt(pth, tts, EMPTY_CTXT)); } else if *self.token == token::LBRACE { // This might be a struct literal. - if self.looking_at_record_literal() { + if self.looking_at_struct_literal() { // It's a struct literal. self.bump(); let mut fields = ~[]; @@ -2513,12 +2505,11 @@ impl Parser { } } - // For distingishing between record literals and blocks - fn looking_at_record_literal(&self) -> bool { + // For distingishing between struct literals and blocks + fn looking_at_struct_literal(&self) -> bool { *self.token == token::LBRACE && - (self.look_ahead(1, |t| token::is_keyword(keywords::Mut, t)) || - (self.look_ahead(1, |t| token::is_plain_ident(t)) && - self.look_ahead(2, |t| *t == token::COLON))) + (self.look_ahead(1, |t| token::is_plain_ident(t)) && + self.look_ahead(2, |t| *t == token::COLON)) } fn parse_match_expr(&self) -> @Expr { |
