]> git.lizzy.rs Git - rust.git/commitdiff
libsyntax: Get rid of some logic for some obsolete syntax.
authorLuqman Aden <laden@csclub.uwaterloo.ca>
Wed, 23 Oct 2013 03:44:55 +0000 (23:44 -0400)
committerLuqman Aden <laden@csclub.uwaterloo.ca>
Fri, 25 Oct 2013 05:21:07 +0000 (01:21 -0400)
src/libsyntax/parse/parser.rs

index d78c6189212dbd9a48ace618891cc60a0dda984c..5a5e310e56f43c4a75e6abe79b3d9383fdf36065 100644 (file)
@@ -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<ast::Ident>) -> @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 {