1
Fork 0

Switch 'cont' to 'again' everywhere. Close #2229.

This commit is contained in:
Graydon Hoare 2012-07-09 14:37:48 -07:00
commit c26d02557e
28 changed files with 47 additions and 47 deletions

View file

@ -785,7 +785,7 @@ fn install_source(c: cargo, path: str) {
for cratefiles.each |cf| {
alt load_crate(cf) {
none { cont; }
none { again; }
some(crate) {
for crate.deps.each |query| {
// FIXME (#1356): handle cyclic dependencies
@ -975,7 +975,7 @@ fn cmd_uninstall(c: cargo) {
}
ret;
}
none { cont; }
none { again; }
}
}
@ -993,7 +993,7 @@ fn cmd_uninstall(c: cargo) {
}
ret;
}
none { cont; }
none { again; }
}
}
for os::list_dir(bin).each |file| {
@ -1007,7 +1007,7 @@ fn cmd_uninstall(c: cargo) {
}
ret;
}
none { cont; }
none { again; }
}
}

View file

@ -548,18 +548,18 @@ fn check_variants(files: ~[str], cx: context) {
if cx.mode == tm_converge && file_might_not_converge(file) {
#error("Skipping convergence test based on\
file_might_not_converge");
cont;
again;
}
let s = @result::get(io::read_whole_file_str(file));
if contains(*s, "#") {
cont; // Macros are confusing
again; // Macros are confusing
}
if cx.mode == tm_converge && content_might_not_converge(*s) {
cont;
again;
}
if cx.mode == tm_run && content_is_dangerous_to_compile(*s) {
cont;
again;
}
log(error, "check_variants: " + file);

View file

@ -53,7 +53,7 @@ impl reader_util for reader {
assert (w > 0u);
if w == 1u {
vec::push(chars, b0 as char );
cont;
again;
}
// can't satisfy this char with the existing data
if end > vec::len(buf) {

View file

@ -1184,7 +1184,7 @@ mod node {
let next_char = get_next_char_in_leaf(it);
alt(next_char) {
option::none {
cont;
again;
}
option::some(_) {
ret next_char;

View file

@ -767,7 +767,7 @@ fn add_new_extension(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
for clauses.each |c| {
alt use_selectors_to_bind(c.params, arg) {
some(bindings) { ret transcribe(cx, bindings, c.body); }
none { cont; }
none { again; }
}
}
cx.span_fatal(sp, "no clauses match macro invocation");

View file

@ -56,7 +56,7 @@ fn strip_doc_comment_decoration(comment: str) -> str {
let mut i = max.get_default(uint::max_value);
for lines.each |line| {
if line.trim().is_empty() {
cont;
again;
}
for line.each_chari |j, c| {
if j >= i {

View file

@ -310,7 +310,7 @@ fn scan_digits(rdr: string_reader, radix: uint) -> str {
let mut rslt = "";
loop {
let c = rdr.curr;
if c == '_' { bump(rdr); cont; }
if c == '_' { bump(rdr); again; }
alt char::to_digit(c, radix) {
some(d) {
str::push_char(rslt, c);

View file

@ -1140,7 +1140,7 @@ class parser {
}
_ { self.unexpected(); }
}
cont;
again;
}
if self.expr_is_complete(e) { break; }
alt copy self.token {

View file

@ -597,7 +597,7 @@ fn link_binary(sess: session,
for cstore::get_used_crate_files(cstore).each |cratepath| {
if str::ends_with(cratepath, ".rlib") {
vec::push(cc_args, cratepath);
cont;
again;
}
let cratepath = cratepath;
let dir = path::dirname(cratepath);

View file

@ -140,7 +140,7 @@ fn encode_class_item_paths(ebml_w: ebml::writer,
items: ~[@class_member], path: ~[ident], &index: ~[entry<str>]) {
for items.each |it| {
alt ast_util::class_member_visibility(it) {
private { cont; }
private { again; }
public {
let (id, ident) = alt it.node {
instance_var(v, _, _, vid, _) { (vid, v) }
@ -158,7 +158,7 @@ fn encode_module_item_paths(ebml_w: ebml::writer, ecx: @encode_ctxt,
&index: ~[entry<str>]) {
for module.items.each |it| {
if !reachable(ecx, it.id) ||
!ast_util::is_exported(it.ident, module) { cont; }
!ast_util::is_exported(it.ident, module) { again; }
if !ast_util::is_item_impl(it) {
add_to_index(ebml_w, path, index, it.ident);
}

View file

@ -247,7 +247,7 @@ impl methods for check_loan_ctxt {
for self.walk_loans(par_scope_id) |old_loan| {
for (*new_loanss).each |new_loans| {
for (*new_loans).each |new_loan| {
if old_loan.lp != new_loan.lp { cont; }
if old_loan.lp != new_loan.lp { again; }
alt (old_loan.mutbl, new_loan.mutbl) {
(m_const, _) | (_, m_const) |
(m_mutbl, m_mutbl) | (m_imm, m_imm) {

View file

@ -176,7 +176,7 @@ fn check_fn(fk: visit::fn_kind, decl: fn_decl, body: blk, sp: span,
let id = ast_util::def_id_of_def(fv.def).node;
// skip over free variables that appear in the cap clause
if captured_vars.contains(id) { cont; }
if captured_vars.contains(id) { again; }
// if this is the last use of the variable, then it will be
// a move and not a copy

View file

@ -2129,7 +2129,7 @@ fn check_exports(e: @env) {
let id = alt check glob.path.node {
ast::view_path_glob(_, node_id) { node_id }
};
if ! glob_is_re_exported.contains_key(id) { cont; }
if ! glob_is_re_exported.contains_key(id) { again; }
do iter_mod(*e, glob.def,
glob.path.span, outside) |ident, def| {
vec::push(_mod.globbed_exports, ident);

View file

@ -1329,7 +1329,7 @@ class Resolver {
for (*impls_in_module).each |implementation| {
if def_ids.contains_key(implementation.did) {
cont;
again;
}
def_ids.insert(implementation.did, ());
@ -1821,7 +1821,7 @@ class Resolver {
if !self.name_is_exported(containing_module, atom) {
#debug("(resolving glob import) name '%s' is unexported",
*(*self.atom_table).atom_to_str(atom));
cont;
again;
}
#debug("(resolving glob import) writing module resolution \
@ -1898,7 +1898,7 @@ class Resolver {
if !self.name_is_exported(containing_module, atom) {
#debug("(resolving glob import) name '%s' is unexported",
*(*self.atom_table).atom_to_str(atom));
cont;
again;
}
let mut dest_import_resolution;
@ -2512,7 +2512,7 @@ class Resolver {
// to fail.
if namespace == ImplNS {
cont;
again;
}
alt self.resolve_definition_of_name_in_module(module,

View file

@ -5441,7 +5441,7 @@ fn crate_ctxt_to_encode_parms(cx: @crate_ctxt)
let mut reexports = ~[];
for cx.exp_map.each |exp_id, defs| {
for defs.each |def| {
if !def.reexp { cont; }
if !def.reexp { again; }
let path = alt check cx.tcx.items.get(exp_id) {
ast_map::node_export(_, path) {
ast_map::path_to_str(*path)

View file

@ -301,7 +301,7 @@ fn llreg_ty(cls: ~[x86_64_reg_class]) -> TypeRef {
vec_len as c_uint);
vec::push(tys, vec_ty);
i += vec_len;
cont;
again;
}
sse_fs_class {
vec::push(tys, T_f32());

View file

@ -170,7 +170,7 @@ class lookup {
for vec::each(*bounds) |bound| {
let (iid, bound_substs) = alt bound {
ty::bound_copy | ty::bound_send | ty::bound_const {
cont; /* ok */
again; /* ok */
}
ty::bound_trait(bound_t) {
alt check ty::get(bound_t).struct {
@ -215,7 +215,7 @@ class lookup {
let ms = *ty::trait_methods(self.tcx(), did);
for ms.eachi |i, m| {
if m.ident != self.m_name { cont; }
if m.ident != self.m_name { again; }
let m_fty = ty::mk_fn(self.tcx(), m.fty);
@ -251,7 +251,7 @@ class lookup {
let ms = *ty::trait_methods(self.tcx(), did);
for ms.each |m| {
if m.ident != self.m_name { cont; }
if m.ident != self.m_name { again; }
if m.vis == ast::private && !self.include_private {
self.tcx().sess.span_fatal(

View file

@ -119,12 +119,12 @@ fn lookup_vtable(fcx: @fn_ctxt, isc: resolve::iscopes, sp: span,
// find the trait that im implements (if any)
let of_ty = alt ty::impl_trait(tcx, im.did) {
some(of_ty) { of_ty }
_ { cont; }
_ { again; }
};
// it must have the same id as the expected one
alt ty::get(of_ty).struct {
ty::ty_trait(id, _) if id != trait_id { cont; }
ty::ty_trait(id, _) if id != trait_id { again; }
_ { /* ok */ }
}
@ -134,7 +134,7 @@ fn lookup_vtable(fcx: @fn_ctxt, isc: resolve::iscopes, sp: span,
impl_self_ty(fcx, im.did);
let im_bs = ty::lookup_item_type(tcx, im.did).bounds;
alt fcx.mk_subty(ty, for_ty) {
result::err(_) { cont; }
result::err(_) { again; }
result::ok(()) { }
}

View file

@ -184,7 +184,7 @@ fn build_reexport_path_map(srv: astsrv::srv, -def_map: def_map) -> path_map {
let mut reexportdocs = ~[];
for defs.each |def| {
if !def.reexp { cont; }
if !def.reexp { again; }
alt def_map.find(def.id) {
some(itemtag) {
reexportdocs += ~[(*name, itemtag)];

View file

@ -207,7 +207,7 @@ fn main(args: ~[str]) {
while !rdr.eof() {
let line: str = rdr.read_line();
if str::len(line) == 0u { cont; }
if str::len(line) == 0u { again; }
alt (line[0], proc_mode) {

View file

@ -155,7 +155,7 @@ fn main(args: ~[str]) {
while !rdr.eof() {
let line: str = rdr.read_line();
if str::len(line) == 0u { cont; }
if str::len(line) == 0u { again; }
alt (line[0], proc_mode) {

View file

@ -10,14 +10,14 @@ fn main() {
if x == 3 { break; } assert (x <= 3);
}
i = 0;
while i < 10 { i += 1; if i % 2 == 0 { cont; } assert (i % 2 != 0); }
while i < 10 { i += 1; if i % 2 == 0 { again; } assert (i % 2 != 0); }
i = 0;
loop {
i += 1; if i % 2 == 0 { cont; } assert (i % 2 != 0);
i += 1; if i % 2 == 0 { again; } assert (i % 2 != 0);
if i >= 10 { break; }
}
for vec::each(~[1, 2, 3, 4, 5, 6]) |x| {
if x % 2 == 0 { cont; }
if x % 2 == 0 { again; }
assert (x % 2 != 0);
}
}

View file

@ -55,10 +55,10 @@ class cat : map<int, bool> {
}
}
fn each_key(&&f: fn(&&int) -> bool) {
for self.each |k, _v| { if !f(k) { break; } cont;};
for self.each |k, _v| { if !f(k) { break; } again;};
}
fn each_value(&&f: fn(&&bool) -> bool) {
for self.each |_k, v| { if !f(v) { break; } cont;};
for self.each |_k, v| { if !f(v) { break; } again;};
}
}

View file

@ -77,10 +77,10 @@ class cat<T: copy> : map<int, T> {
}
fn each_key(&&f: fn(&&int) -> bool) {
for self.each |k, _v| { if !f(k) { break; } cont;};
for self.each |k, _v| { if !f(k) { break; } again;};
}
fn each_value(&&f: fn(&&T) -> bool) {
for self.each |_k, v| { if !f(v) { break; } cont;};
for self.each |_k, v| { if !f(v) { break; } again;};
}
}

View file

@ -17,7 +17,7 @@ fn main() {
is_even = false;
i += 1u;
if i % 2u != 0u {
cont;
again;
}
is_even = true;
}
@ -30,7 +30,7 @@ fn main() {
is_even = false;
i += 1u;
if i % 2u != 0u {
cont;
again;
}
is_even = true;
}

View file

@ -40,7 +40,7 @@ fn main() {
for vec::all(~[1, 2, 3, 4, 5, 6, 7]) |e| {
last = e;
if e == 5 { break; }
if e % 2 == 1 { cont; }
if e % 2 == 1 { again; }
assert e % 2 == 0;
};
assert last == 5;

View file

@ -6,7 +6,7 @@ use std;
fn test_break() { loop { let x: @int = break; } }
fn test_cont() { let mut i = 0; while i < 1 { i += 1; let x: @int = cont; } }
fn test_cont() { let mut i = 0; while i < 1 { i += 1; let x: @int = again; } }
fn test_ret() { let x: @int = ret; }

View file

@ -5,6 +5,6 @@ fn main() {
assert (i > 0);
log(debug, i);
i -= 1;
cont;
again;
}
}