libsyntax: 0u -> 0us, 0i -> 0is

This commit is contained in:
Paul Collier 2015-01-18 00:41:56 +00:00
parent 591337431d
commit 3c32cd1be2
16 changed files with 156 additions and 156 deletions

View file

@ -748,7 +748,7 @@ impl<'a> MethodDef<'a> {
let mut raw_fields = Vec::new(); // ~[[fields of self],
// [fields of next Self arg], [etc]]
let mut patterns = Vec::new();
for i in range(0u, self_args.len()) {
for i in range(0us, self_args.len()) {
let struct_path= cx.path(DUMMY_SP, vec!( type_ident ));
let (pat, ident_expr) =
trait_.create_struct_pattern(cx,
@ -837,8 +837,8 @@ impl<'a> MethodDef<'a> {
/// (&A2(ref __self_0),
/// &A2(ref __arg_1_0)) => (*__self_0).eq(&(*__arg_1_0)),
/// _ => {
/// let __self_vi = match *self { A1(..) => 0u, A2(..) => 1u };
/// let __arg_1_vi = match *__arg_1 { A1(..) => 0u, A2(..) => 1u };
/// let __self_vi = match *self { A1(..) => 0us, A2(..) => 1us };
/// let __arg_1_vi = match *__arg_1 { A1(..) => 0us, A2(..) => 1us };
/// false
/// }
/// }
@ -882,8 +882,8 @@ impl<'a> MethodDef<'a> {
/// (Variant2, Variant2, Variant2) => ... // delegate Matching on Variant2
/// ...
/// _ => {
/// let __this_vi = match this { Variant1 => 0u, Variant2 => 1u, ... };
/// let __that_vi = match that { Variant1 => 0u, Variant2 => 1u, ... };
/// let __this_vi = match this { Variant1 => 0us, Variant2 => 1us, ... };
/// let __that_vi = match that { Variant1 => 0us, Variant2 => 1us, ... };
/// ... // catch-all remainder can inspect above variant index values.
/// }
/// }
@ -1045,13 +1045,13 @@ impl<'a> MethodDef<'a> {
//
// ```
// let __self0_vi = match self {
// A => 0u, B(..) => 1u, C(..) => 2u
// A => 0us, B(..) => 1us, C(..) => 2us
// };
// let __self1_vi = match __arg1 {
// A => 0u, B(..) => 1u, C(..) => 2u
// A => 0us, B(..) => 1us, C(..) => 2us
// };
// let __self2_vi = match __arg2 {
// A => 0u, B(..) => 1u, C(..) => 2u
// A => 0us, B(..) => 1us, C(..) => 2us
// };
// ```
let mut index_let_stmts: Vec<P<ast::Stmt>> = Vec::new();

View file

@ -273,7 +273,7 @@ fn expand_mac_invoc<T, F, G>(mac: ast::Mac, span: codemap::Span,
// in this file.
// Token-tree macros:
MacInvocTT(pth, tts, _) => {
if pth.segments.len() > 1u {
if pth.segments.len() > 1us {
fld.cx.span_err(pth.span,
"expected macro name without module \
separators");
@ -844,7 +844,7 @@ fn expand_pat(p: P<ast::Pat>, fld: &mut MacroExpander) -> P<ast::Pat> {
},
_ => unreachable!()
};
if pth.segments.len() > 1u {
if pth.segments.len() > 1us {
fld.cx.span_err(pth.span, "expected macro name without module separators");
return DummyResult::raw_pat(span);
}

View file

@ -716,7 +716,7 @@ fn expand_tts(cx: &ExtCtxt, sp: Span, tts: &[ast::TokenTree])
// try removing it when enough of them are gone.
let mut p = cx.new_parser_from_tts(tts);
p.quote_depth += 1u;
p.quote_depth += 1us;
let cx_expr = p.parse_expr();
if !p.eat(&token::Comma) {

View file

@ -171,11 +171,11 @@ pub fn initial_matcher_pos(ms: Rc<Vec<TokenTree>>, sep: Option<Token>, lo: ByteP
stack: vec![],
top_elts: TtSeq(ms),
sep: sep,
idx: 0u,
idx: 0us,
up: None,
matches: matches,
match_lo: 0u,
match_cur: 0u,
match_lo: 0us,
match_cur: 0us,
match_hi: match_idx_hi,
sp_lo: lo
}
@ -238,7 +238,7 @@ pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc<NamedMatch>])
}
}
let mut ret_val = HashMap::new();
let mut idx = 0u;
let mut idx = 0us;
for m in ms.iter() { n_rec(p_s, m, res, &mut ret_val, &mut idx) }
ret_val
}
@ -383,7 +383,7 @@ pub fn parse(sess: &ParseSess,
if seq.op == ast::ZeroOrMore {
let mut new_ei = ei.clone();
new_ei.match_cur += seq.num_captures;
new_ei.idx += 1u;
new_ei.idx += 1us;
//we specifically matched zero repeats.
for idx in range(ei.match_cur, ei.match_cur + seq.num_captures) {
(&mut new_ei.matches[idx]).push(Rc::new(MatchedSeq(vec![], sp)));
@ -398,7 +398,7 @@ pub fn parse(sess: &ParseSess,
cur_eis.push(box MatcherPos {
stack: vec![],
sep: seq.separator.clone(),
idx: 0u,
idx: 0us,
matches: matches,
match_lo: ei_t.match_cur,
match_cur: ei_t.match_cur,
@ -442,20 +442,20 @@ pub fn parse(sess: &ParseSess,
/* error messages here could be improved with links to orig. rules */
if token_name_eq(&tok, &token::Eof) {
if eof_eis.len() == 1u {
if eof_eis.len() == 1us {
let mut v = Vec::new();
for dv in (&mut eof_eis[0]).matches.iter_mut() {
v.push(dv.pop().unwrap());
}
return Success(nameize(sess, ms, &v[]));
} else if eof_eis.len() > 1u {
} else if eof_eis.len() > 1us {
return Error(sp, "ambiguity: multiple successful parses".to_string());
} else {
return Failure(sp, "unexpected end of macro invocation".to_string());
}
} else {
if (bb_eis.len() > 0u && next_eis.len() > 0u)
|| bb_eis.len() > 1u {
if (bb_eis.len() > 0us && next_eis.len() > 0us)
|| bb_eis.len() > 1us {
let nts = bb_eis.iter().map(|ei| {
match ei.top_elts.get_tt(ei.idx) {
TtToken(_, MatchNt(bind, name, _, _)) => {
@ -469,12 +469,12 @@ pub fn parse(sess: &ParseSess,
"local ambiguity: multiple parsing options: \
built-in NTs {} or {} other options.",
nts, next_eis.len()).to_string());
} else if bb_eis.len() == 0u && next_eis.len() == 0u {
} else if bb_eis.len() == 0us && next_eis.len() == 0us {
return Failure(sp, format!("no rules expected the token `{}`",
pprust::token_to_string(&tok)).to_string());
} else if next_eis.len() > 0u {
} else if next_eis.len() > 0us {
/* Now process the next token */
while next_eis.len() > 0u {
while next_eis.len() > 0us {
cur_eis.push(next_eis.pop().unwrap());
}
rdr.next_token();
@ -488,7 +488,7 @@ pub fn parse(sess: &ParseSess,
let match_cur = ei.match_cur;
(&mut ei.matches[match_cur]).push(Rc::new(MatchedNonterminal(
parse_nt(&mut rust_parser, name_string.get()))));
ei.idx += 1u;
ei.idx += 1us;
ei.match_cur += 1;
}
_ => panic!()
@ -501,16 +501,16 @@ pub fn parse(sess: &ParseSess,
}
}
assert!(cur_eis.len() > 0u);
assert!(cur_eis.len() > 0us);
}
}
pub fn parse_nt(p: &mut Parser, name: &str) -> Nonterminal {
match name {
"tt" => {
p.quote_depth += 1u; //but in theory, non-quoted tts might be useful
p.quote_depth += 1us; //but in theory, non-quoted tts might be useful
let res = token::NtTT(P(p.parse_token_tree()));
p.quote_depth -= 1u;
p.quote_depth -= 1us;
return res;
}
_ => {}

View file

@ -223,7 +223,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
r.repeat_len.pop();
}
} else { /* repeat */
*r.repeat_idx.last_mut().unwrap() += 1u;
*r.repeat_idx.last_mut().unwrap() += 1us;
r.stack.last_mut().unwrap().idx = 0;
match r.stack.last().unwrap().sep.clone() {
Some(tk) => {