about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2012-07-09 14:37:48 -0700
committerGraydon Hoare <graydon@mozilla.com>2012-07-09 14:37:48 -0700
commitc26d02557e77ef02bf897563a38867ff0da3fc2a (patch)
tree4f37e678d3b138386b7b9549081f266a12259d42 /src
parent9afc8be04b7fb2927fa33d41f8618ca7fb9285bb (diff)
downloadrust-c26d02557e77ef02bf897563a38867ff0da3fc2a.tar.gz
rust-c26d02557e77ef02bf897563a38867ff0da3fc2a.zip
Switch 'cont' to 'again' everywhere. Close #2229.
Diffstat (limited to 'src')
-rw-r--r--src/cargo/cargo.rs8
-rw-r--r--src/fuzzer/fuzzer.rs8
-rw-r--r--src/libcore/io.rs2
-rw-r--r--src/libstd/rope.rs2
-rw-r--r--src/libsyntax/ext/simplext.rs2
-rw-r--r--src/libsyntax/parse/comments.rs2
-rw-r--r--src/libsyntax/parse/lexer.rs2
-rw-r--r--src/libsyntax/parse/parser.rs2
-rw-r--r--src/rustc/back/link.rs2
-rw-r--r--src/rustc/metadata/encoder.rs4
-rw-r--r--src/rustc/middle/borrowck/check_loans.rs2
-rw-r--r--src/rustc/middle/kind.rs2
-rw-r--r--src/rustc/middle/resolve.rs2
-rw-r--r--src/rustc/middle/resolve3.rs8
-rw-r--r--src/rustc/middle/trans/base.rs2
-rw-r--r--src/rustc/middle/trans/foreign.rs2
-rw-r--r--src/rustc/middle/typeck/check/method.rs6
-rw-r--r--src/rustc/middle/typeck/check/vtable.rs6
-rw-r--r--src/rustdoc/reexport_pass.rs2
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs2
-rw-r--r--src/test/bench/shootout-k-nucleotide.rs2
-rw-r--r--src/test/run-pass/break.rs6
-rw-r--r--src/test/run-pass/class-impl-parameterized-iface.rs4
-rw-r--r--src/test/run-pass/class-impl-very-parameterized-iface.rs4
-rw-r--r--src/test/run-pass/loop-break-cont.rs4
-rw-r--r--src/test/run-pass/ret-break-cont-in-block.rs2
-rw-r--r--src/test/run-pass/terminate-in-initializer.rs2
-rw-r--r--src/test/run-pass/while-cont.rs2
28 files changed, 47 insertions, 47 deletions
diff --git a/src/cargo/cargo.rs b/src/cargo/cargo.rs
index efed7db81cf..e69945c97b9 100644
--- a/src/cargo/cargo.rs
+++ b/src/cargo/cargo.rs
@@ -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; }
             }
         }
 
diff --git a/src/fuzzer/fuzzer.rs b/src/fuzzer/fuzzer.rs
index 4faf7a2f48d..d7d1e147d0b 100644
--- a/src/fuzzer/fuzzer.rs
+++ b/src/fuzzer/fuzzer.rs
@@ -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);
diff --git a/src/libcore/io.rs b/src/libcore/io.rs
index 14c5736120b..f9666a1f22e 100644
--- a/src/libcore/io.rs
+++ b/src/libcore/io.rs
@@ -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) {
diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs
index 187640a54cf..4dc5116b509 100644
--- a/src/libstd/rope.rs
+++ b/src/libstd/rope.rs
@@ -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;
diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs
index 2f811891711..c9355f05e38 100644
--- a/src/libsyntax/ext/simplext.rs
+++ b/src/libsyntax/ext/simplext.rs
@@ -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");
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index bd164402c1d..d351d492fb0 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -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 {
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index 467f1896979..600aa9f4c42 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -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);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index ba31a610f27..6a166591887 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1140,7 +1140,7 @@ class parser {
                   }
                   _ { self.unexpected(); }
                 }
-                cont;
+                again;
             }
             if self.expr_is_complete(e) { break; }
             alt copy self.token {
diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs
index 2ef5fb17dd8..0d399bd6303 100644
--- a/src/rustc/back/link.rs
+++ b/src/rustc/back/link.rs
@@ -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);
diff --git a/src/rustc/metadata/encoder.rs b/src/rustc/metadata/encoder.rs
index 1e50f1168c7..f68995db14b 100644
--- a/src/rustc/metadata/encoder.rs
+++ b/src/rustc/metadata/encoder.rs
@@ -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);
         }
diff --git a/src/rustc/middle/borrowck/check_loans.rs b/src/rustc/middle/borrowck/check_loans.rs
index ab1e9b5505e..4b80e934416 100644
--- a/src/rustc/middle/borrowck/check_loans.rs
+++ b/src/rustc/middle/borrowck/check_loans.rs
@@ -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) {
diff --git a/src/rustc/middle/kind.rs b/src/rustc/middle/kind.rs
index f84dd4b0652..b4709820276 100644
--- a/src/rustc/middle/kind.rs
+++ b/src/rustc/middle/kind.rs
@@ -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
diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs
index d8b1f4db640..d1198d86b98 100644
--- a/src/rustc/middle/resolve.rs
+++ b/src/rustc/middle/resolve.rs
@@ -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);
diff --git a/src/rustc/middle/resolve3.rs b/src/rustc/middle/resolve3.rs
index 69d3a25d5a1..1f6e0f6e127 100644
--- a/src/rustc/middle/resolve3.rs
+++ b/src/rustc/middle/resolve3.rs
@@ -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,
diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs
index 5534140ae72..e987f0f3f13 100644
--- a/src/rustc/middle/trans/base.rs
+++ b/src/rustc/middle/trans/base.rs
@@ -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)
diff --git a/src/rustc/middle/trans/foreign.rs b/src/rustc/middle/trans/foreign.rs
index 39a5215b779..3da69f9b778 100644
--- a/src/rustc/middle/trans/foreign.rs
+++ b/src/rustc/middle/trans/foreign.rs
@@ -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());
diff --git a/src/rustc/middle/typeck/check/method.rs b/src/rustc/middle/typeck/check/method.rs
index b91f9778e1c..f1a79fad49b 100644
--- a/src/rustc/middle/typeck/check/method.rs
+++ b/src/rustc/middle/typeck/check/method.rs
@@ -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(
diff --git a/src/rustc/middle/typeck/check/vtable.rs b/src/rustc/middle/typeck/check/vtable.rs
index 0c273808001..42d2529415f 100644
--- a/src/rustc/middle/typeck/check/vtable.rs
+++ b/src/rustc/middle/typeck/check/vtable.rs
@@ -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(()) { }
                 }
 
diff --git a/src/rustdoc/reexport_pass.rs b/src/rustdoc/reexport_pass.rs
index 354035b6f56..8351d6a3146 100644
--- a/src/rustdoc/reexport_pass.rs
+++ b/src/rustdoc/reexport_pass.rs
@@ -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)];
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index 7212bbc765b..d686f8bcd91 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -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) {
 
diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs
index 0054aad92f6..c32ebcc0b45 100644
--- a/src/test/bench/shootout-k-nucleotide.rs
+++ b/src/test/bench/shootout-k-nucleotide.rs
@@ -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) {
 
diff --git a/src/test/run-pass/break.rs b/src/test/run-pass/break.rs
index d8c6fb29c3b..2dcb9d6f678 100644
--- a/src/test/run-pass/break.rs
+++ b/src/test/run-pass/break.rs
@@ -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);
     }
 }
diff --git a/src/test/run-pass/class-impl-parameterized-iface.rs b/src/test/run-pass/class-impl-parameterized-iface.rs
index 3c445862821..800e42a750b 100644
--- a/src/test/run-pass/class-impl-parameterized-iface.rs
+++ b/src/test/run-pass/class-impl-parameterized-iface.rs
@@ -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;};
   }
 }
 
diff --git a/src/test/run-pass/class-impl-very-parameterized-iface.rs b/src/test/run-pass/class-impl-very-parameterized-iface.rs
index 3ebd9071993..687efb5ead5 100644
--- a/src/test/run-pass/class-impl-very-parameterized-iface.rs
+++ b/src/test/run-pass/class-impl-very-parameterized-iface.rs
@@ -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;};
   }
 }
 
diff --git a/src/test/run-pass/loop-break-cont.rs b/src/test/run-pass/loop-break-cont.rs
index a62526de7da..2fa706e5777 100644
--- a/src/test/run-pass/loop-break-cont.rs
+++ b/src/test/run-pass/loop-break-cont.rs
@@ -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;
   }
diff --git a/src/test/run-pass/ret-break-cont-in-block.rs b/src/test/run-pass/ret-break-cont-in-block.rs
index 9df02394887..c94f0640180 100644
--- a/src/test/run-pass/ret-break-cont-in-block.rs
+++ b/src/test/run-pass/ret-break-cont-in-block.rs
@@ -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;
diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs
index f491ad97d68..3064583b752 100644
--- a/src/test/run-pass/terminate-in-initializer.rs
+++ b/src/test/run-pass/terminate-in-initializer.rs
@@ -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; }
 
diff --git a/src/test/run-pass/while-cont.rs b/src/test/run-pass/while-cont.rs
index 24b0d530fc3..be3ec48c8a6 100644
--- a/src/test/run-pass/while-cont.rs
+++ b/src/test/run-pass/while-cont.rs
@@ -5,6 +5,6 @@ fn main() {
         assert (i > 0);
         log(debug, i);
         i -= 1;
-        cont;
+        again;
     }
 }