Skip to content

Commit dbcc0f7

Browse files
committed
---
yaml --- r: 44745 b: refs/heads/master c: 28691a0 h: refs/heads/master i: 44743: 992e995 v: v3
1 parent 27381df commit dbcc0f7

File tree

4 files changed

+33
-33
lines changed

4 files changed

+33
-33
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ff36986fa490917bcacfb4e5010e304d5e82f3bb
2+
refs/heads/master: 28691a0852854a9996d07ab92bb55e92beef2c98
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/libsyntax/parse/attr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ impl parser_attr for Parser {
161161

162162
fn parse_optional_meta() -> ~[@ast::meta_item] {
163163
match *self.token {
164-
token::LPAREN => return self.parse_meta_seq(),
165-
_ => return ~[]
164+
token::LPAREN => self.parse_meta_seq(),
165+
_ => ~[]
166166
}
167167
}
168168
}

trunk/src/libsyntax/parse/common.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ pub impl Parser {
139139

140140
fn token_is_word(word: &~str, tok: &token::Token) -> bool {
141141
match *tok {
142-
token::IDENT(sid, false) => { *self.id_to_str(sid) == *word }
143-
_ => { false }
142+
token::IDENT(sid, false) => { *self.id_to_str(sid) == *word }
143+
_ => { false }
144144
}
145145
}
146146

@@ -165,8 +165,8 @@ pub impl Parser {
165165
fn eat_keyword(word: &~str) -> bool {
166166
self.require_keyword(word);
167167
let is_kw = match *self.token {
168-
token::IDENT(sid, false) => *word == *self.id_to_str(sid),
169-
_ => false
168+
token::IDENT(sid, false) => *word == *self.id_to_str(sid),
169+
_ => false
170170
};
171171
if is_kw { self.bump() }
172172
is_kw

trunk/src/libsyntax/parse/parser.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ pub impl Parser {
633633
seq_sep_trailing_allowed(token::COMMA),
634634
|p| p.parse_ty_field()
635635
);
636-
if vec::len(elems) == 0u {
636+
if elems.len() == 0 {
637637
self.unexpected_last(token::RBRACE);
638638
}
639639
ty_rec(elems)
@@ -858,17 +858,17 @@ pub impl Parser {
858858
}
859859
}
860860

861-
fn lit_from_token(tok: token::Token) -> lit_ {
862-
match tok {
863-
token::LIT_INT(i, it) => lit_int(i, it),
864-
token::LIT_UINT(u, ut) => lit_uint(u, ut),
865-
token::LIT_INT_UNSUFFIXED(i) => lit_int_unsuffixed(i),
866-
token::LIT_FLOAT(s, ft) => lit_float(self.id_to_str(s), ft),
867-
token::LIT_FLOAT_UNSUFFIXED(s) =>
868-
lit_float_unsuffixed(self.id_to_str(s)),
869-
token::LIT_STR(s) => lit_str(self.id_to_str(s)),
870-
token::LPAREN => { self.expect(&token::RPAREN); lit_nil },
871-
_ => { self.unexpected_last(tok); }
861+
fn lit_from_token(tok: &token::Token) -> lit_ {
862+
match *tok {
863+
token::LIT_INT(i, it) => lit_int(i, it),
864+
token::LIT_UINT(u, ut) => lit_uint(u, ut),
865+
token::LIT_INT_UNSUFFIXED(i) => lit_int_unsuffixed(i),
866+
token::LIT_FLOAT(s, ft) => lit_float(self.id_to_str(s), ft),
867+
token::LIT_FLOAT_UNSUFFIXED(s) =>
868+
lit_float_unsuffixed(self.id_to_str(s)),
869+
token::LIT_STR(s) => lit_str(self.id_to_str(s)),
870+
token::LPAREN => { self.expect(&token::RPAREN); lit_nil },
871+
_ => { self.unexpected_last(*tok); }
872872
}
873873
}
874874

@@ -882,7 +882,7 @@ pub impl Parser {
882882
// XXX: This is a really bad copy!
883883
let tok = copy *self.token;
884884
self.bump();
885-
self.lit_from_token(tok)
885+
self.lit_from_token(&tok)
886886
};
887887
codemap::spanned { node: lit, span: mk_sp(lo, self.last_span.hi) }
888888
}
@@ -1240,8 +1240,8 @@ pub impl Parser {
12401240
if *self.token == token::NOT {
12411241
self.bump();
12421242
match *self.token {
1243-
token::LPAREN | token::LBRACE => {}
1244-
_ => self.fatal(~"expected open delimiter")
1243+
token::LPAREN | token::LBRACE => {}
1244+
_ => self.fatal(~"expected open delimiter")
12451245
};
12461246

12471247
let ket = token::flip_delimiter(&*self.token);
@@ -2554,7 +2554,8 @@ pub impl Parser {
25542554
self.expect(&token::LBRACE);
25552555
let (inner, next) =
25562556
maybe_parse_inner_attrs_and_next(self, parse_attrs);
2557-
return (inner, self.parse_block_tail_(lo, default_blk, next));
2557+
2558+
(inner, self.parse_block_tail_(lo, default_blk, next))
25582559
}
25592560

25602561
fn parse_block_no_value() -> blk {
@@ -2624,10 +2625,7 @@ pub impl Parser {
26242625
fmt!(
26252626
"expected `;` or `}` after \
26262627
expression but found `%s`",
2627-
token_to_str(
2628-
self.reader,
2629-
&t
2630-
)
2628+
token_to_str(self.reader, &t)
26312629
)
26322630
);
26332631
}
@@ -2823,12 +2821,14 @@ pub impl Parser {
28232821
self.bump();
28242822
}
28252823

2826-
fn parse_fn_decl_with_self(parse_arg_fn:
2827-
fn(Parser) -> arg_or_capture_item)
2828-
-> (self_ty, fn_decl) {
2829-
2830-
fn maybe_parse_self_ty(cnstr: fn(+v: mutability) -> ast::self_ty_,
2831-
p: Parser) -> ast::self_ty_ {
2824+
fn parse_fn_decl_with_self(
2825+
parse_arg_fn:
2826+
fn(Parser) -> arg_or_capture_item
2827+
) -> (self_ty, fn_decl) {
2828+
fn maybe_parse_self_ty(
2829+
cnstr: fn(+v: mutability) -> ast::self_ty_,
2830+
p: Parser
2831+
) -> ast::self_ty_ {
28322832
// We need to make sure it isn't a mode or a type
28332833
if p.token_is_keyword(&~"self", &p.look_ahead(1)) ||
28342834
((p.token_is_keyword(&~"const", &p.look_ahead(1)) ||

0 commit comments

Comments
 (0)