Skip to content

Commit 99b7662

Browse files
committed
libsyntax: Get rid of some logic for some obsolete syntax.
1 parent 12308db commit 99b7662

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,15 +1184,7 @@ impl Parser {
11841184
pub fn is_named_argument(&self) -> bool {
11851185
let offset = match *self.token {
11861186
token::BINOP(token::AND) => 1,
1187-
token::BINOP(token::MINUS) => 1,
11881187
token::ANDAND => 1,
1189-
token::BINOP(token::PLUS) => {
1190-
if self.look_ahead(1, |t| *t == token::BINOP(token::PLUS)) {
1191-
2
1192-
} else {
1193-
1
1194-
}
1195-
},
11961188
_ if token::is_keyword(keywords::Mut, self.token) => 1,
11971189
_ => 0
11981190
};
@@ -1802,7 +1794,7 @@ impl Parser {
18021794
return self.mk_mac_expr(lo, hi, mac_invoc_tt(pth, tts, EMPTY_CTXT));
18031795
} else if *self.token == token::LBRACE {
18041796
// This might be a struct literal.
1805-
if self.looking_at_record_literal() {
1797+
if self.looking_at_struct_literal() {
18061798
// It's a struct literal.
18071799
self.bump();
18081800
let mut fields = ~[];
@@ -2513,12 +2505,11 @@ impl Parser {
25132505
}
25142506
}
25152507

2516-
// For distingishing between record literals and blocks
2517-
fn looking_at_record_literal(&self) -> bool {
2508+
// For distingishing between struct literals and blocks
2509+
fn looking_at_struct_literal(&self) -> bool {
25182510
*self.token == token::LBRACE &&
2519-
(self.look_ahead(1, |t| token::is_keyword(keywords::Mut, t)) ||
2520-
(self.look_ahead(1, |t| token::is_plain_ident(t)) &&
2521-
self.look_ahead(2, |t| *t == token::COLON)))
2511+
(self.look_ahead(1, |t| token::is_plain_ident(t)) &&
2512+
self.look_ahead(2, |t| *t == token::COLON))
25222513
}
25232514

25242515
fn parse_match_expr(&self) -> @Expr {

0 commit comments

Comments
 (0)