From 99b7662971e97cf53669b2f5620dcd9ff8b98bc3 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Tue, 22 Oct 2013 23:44:55 -0400 Subject: [PATCH] libsyntax: Get rid of some logic for some obsolete syntax. --- src/libsyntax/parse/parser.rs | 19 +++++-------------- 1 file 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 @@ pub fn parse_borrowed_pointee(&self) -> ty_ { 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 @@ pub fn parse_bottom_expr(&self) -> @Expr { 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 @@ pub fn parse_loop_expr(&self, opt_ident: Option) -> @Expr { } } - // 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 { -- 2.44.0