Skip to content

Commit c26d025

Browse files
committed
Switch 'cont' to 'again' everywhere. Close #2229.
1 parent 9afc8be commit c26d025

28 files changed

+47
-47
lines changed

src/cargo/cargo.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ fn install_source(c: cargo, path: str) {
785785

786786
for cratefiles.each |cf| {
787787
alt load_crate(cf) {
788-
none { cont; }
788+
none { again; }
789789
some(crate) {
790790
for crate.deps.each |query| {
791791
// FIXME (#1356): handle cyclic dependencies
@@ -975,7 +975,7 @@ fn cmd_uninstall(c: cargo) {
975975
}
976976
ret;
977977
}
978-
none { cont; }
978+
none { again; }
979979
}
980980
}
981981

@@ -993,7 +993,7 @@ fn cmd_uninstall(c: cargo) {
993993
}
994994
ret;
995995
}
996-
none { cont; }
996+
none { again; }
997997
}
998998
}
999999
for os::list_dir(bin).each |file| {
@@ -1007,7 +1007,7 @@ fn cmd_uninstall(c: cargo) {
10071007
}
10081008
ret;
10091009
}
1010-
none { cont; }
1010+
none { again; }
10111011
}
10121012
}
10131013

src/fuzzer/fuzzer.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -548,18 +548,18 @@ fn check_variants(files: ~[str], cx: context) {
548548
if cx.mode == tm_converge && file_might_not_converge(file) {
549549
#error("Skipping convergence test based on\
550550
file_might_not_converge");
551-
cont;
551+
again;
552552
}
553553

554554
let s = @result::get(io::read_whole_file_str(file));
555555
if contains(*s, "#") {
556-
cont; // Macros are confusing
556+
again; // Macros are confusing
557557
}
558558
if cx.mode == tm_converge && content_might_not_converge(*s) {
559-
cont;
559+
again;
560560
}
561561
if cx.mode == tm_run && content_is_dangerous_to_compile(*s) {
562-
cont;
562+
again;
563563
}
564564

565565
log(error, "check_variants: " + file);

src/libcore/io.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl reader_util for reader {
5353
assert (w > 0u);
5454
if w == 1u {
5555
vec::push(chars, b0 as char );
56-
cont;
56+
again;
5757
}
5858
// can't satisfy this char with the existing data
5959
if end > vec::len(buf) {

src/libstd/rope.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ mod node {
11841184
let next_char = get_next_char_in_leaf(it);
11851185
alt(next_char) {
11861186
option::none {
1187-
cont;
1187+
again;
11881188
}
11891189
option::some(_) {
11901190
ret next_char;

src/libsyntax/ext/simplext.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ fn add_new_extension(cx: ext_ctxt, sp: span, arg: ast::mac_arg,
767767
for clauses.each |c| {
768768
alt use_selectors_to_bind(c.params, arg) {
769769
some(bindings) { ret transcribe(cx, bindings, c.body); }
770-
none { cont; }
770+
none { again; }
771771
}
772772
}
773773
cx.span_fatal(sp, "no clauses match macro invocation");

src/libsyntax/parse/comments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn strip_doc_comment_decoration(comment: str) -> str {
5656
let mut i = max.get_default(uint::max_value);
5757
for lines.each |line| {
5858
if line.trim().is_empty() {
59-
cont;
59+
again;
6060
}
6161
for line.each_chari |j, c| {
6262
if j >= i {

src/libsyntax/parse/lexer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ fn scan_digits(rdr: string_reader, radix: uint) -> str {
310310
let mut rslt = "";
311311
loop {
312312
let c = rdr.curr;
313-
if c == '_' { bump(rdr); cont; }
313+
if c == '_' { bump(rdr); again; }
314314
alt char::to_digit(c, radix) {
315315
some(d) {
316316
str::push_char(rslt, c);

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ class parser {
11401140
}
11411141
_ { self.unexpected(); }
11421142
}
1143-
cont;
1143+
again;
11441144
}
11451145
if self.expr_is_complete(e) { break; }
11461146
alt copy self.token {

src/rustc/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ fn link_binary(sess: session,
597597
for cstore::get_used_crate_files(cstore).each |cratepath| {
598598
if str::ends_with(cratepath, ".rlib") {
599599
vec::push(cc_args, cratepath);
600-
cont;
600+
again;
601601
}
602602
let cratepath = cratepath;
603603
let dir = path::dirname(cratepath);

src/rustc/metadata/encoder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ fn encode_class_item_paths(ebml_w: ebml::writer,
140140
items: ~[@class_member], path: ~[ident], &index: ~[entry<str>]) {
141141
for items.each |it| {
142142
alt ast_util::class_member_visibility(it) {
143-
private { cont; }
143+
private { again; }
144144
public {
145145
let (id, ident) = alt it.node {
146146
instance_var(v, _, _, vid, _) { (vid, v) }
@@ -158,7 +158,7 @@ fn encode_module_item_paths(ebml_w: ebml::writer, ecx: @encode_ctxt,
158158
&index: ~[entry<str>]) {
159159
for module.items.each |it| {
160160
if !reachable(ecx, it.id) ||
161-
!ast_util::is_exported(it.ident, module) { cont; }
161+
!ast_util::is_exported(it.ident, module) { again; }
162162
if !ast_util::is_item_impl(it) {
163163
add_to_index(ebml_w, path, index, it.ident);
164164
}

src/rustc/middle/borrowck/check_loans.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl methods for check_loan_ctxt {
247247
for self.walk_loans(par_scope_id) |old_loan| {
248248
for (*new_loanss).each |new_loans| {
249249
for (*new_loans).each |new_loan| {
250-
if old_loan.lp != new_loan.lp { cont; }
250+
if old_loan.lp != new_loan.lp { again; }
251251
alt (old_loan.mutbl, new_loan.mutbl) {
252252
(m_const, _) | (_, m_const) |
253253
(m_mutbl, m_mutbl) | (m_imm, m_imm) {

src/rustc/middle/kind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn check_fn(fk: visit::fn_kind, decl: fn_decl, body: blk, sp: span,
176176
let id = ast_util::def_id_of_def(fv.def).node;
177177

178178
// skip over free variables that appear in the cap clause
179-
if captured_vars.contains(id) { cont; }
179+
if captured_vars.contains(id) { again; }
180180

181181
// if this is the last use of the variable, then it will be
182182
// a move and not a copy

src/rustc/middle/resolve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ fn check_exports(e: @env) {
21292129
let id = alt check glob.path.node {
21302130
ast::view_path_glob(_, node_id) { node_id }
21312131
};
2132-
if ! glob_is_re_exported.contains_key(id) { cont; }
2132+
if ! glob_is_re_exported.contains_key(id) { again; }
21332133
do iter_mod(*e, glob.def,
21342134
glob.path.span, outside) |ident, def| {
21352135
vec::push(_mod.globbed_exports, ident);

src/rustc/middle/resolve3.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ class Resolver {
13291329

13301330
for (*impls_in_module).each |implementation| {
13311331
if def_ids.contains_key(implementation.did) {
1332-
cont;
1332+
again;
13331333
}
13341334
def_ids.insert(implementation.did, ());
13351335

@@ -1821,7 +1821,7 @@ class Resolver {
18211821
if !self.name_is_exported(containing_module, atom) {
18221822
#debug("(resolving glob import) name '%s' is unexported",
18231823
*(*self.atom_table).atom_to_str(atom));
1824-
cont;
1824+
again;
18251825
}
18261826

18271827
#debug("(resolving glob import) writing module resolution \
@@ -1898,7 +1898,7 @@ class Resolver {
18981898
if !self.name_is_exported(containing_module, atom) {
18991899
#debug("(resolving glob import) name '%s' is unexported",
19001900
*(*self.atom_table).atom_to_str(atom));
1901-
cont;
1901+
again;
19021902
}
19031903

19041904
let mut dest_import_resolution;
@@ -2512,7 +2512,7 @@ class Resolver {
25122512
// to fail.
25132513

25142514
if namespace == ImplNS {
2515-
cont;
2515+
again;
25162516
}
25172517

25182518
alt self.resolve_definition_of_name_in_module(module,

src/rustc/middle/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5441,7 +5441,7 @@ fn crate_ctxt_to_encode_parms(cx: @crate_ctxt)
54415441
let mut reexports = ~[];
54425442
for cx.exp_map.each |exp_id, defs| {
54435443
for defs.each |def| {
5444-
if !def.reexp { cont; }
5444+
if !def.reexp { again; }
54455445
let path = alt check cx.tcx.items.get(exp_id) {
54465446
ast_map::node_export(_, path) {
54475447
ast_map::path_to_str(*path)

src/rustc/middle/trans/foreign.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ fn llreg_ty(cls: ~[x86_64_reg_class]) -> TypeRef {
301301
vec_len as c_uint);
302302
vec::push(tys, vec_ty);
303303
i += vec_len;
304-
cont;
304+
again;
305305
}
306306
sse_fs_class {
307307
vec::push(tys, T_f32());

src/rustc/middle/typeck/check/method.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class lookup {
170170
for vec::each(*bounds) |bound| {
171171
let (iid, bound_substs) = alt bound {
172172
ty::bound_copy | ty::bound_send | ty::bound_const {
173-
cont; /* ok */
173+
again; /* ok */
174174
}
175175
ty::bound_trait(bound_t) {
176176
alt check ty::get(bound_t).struct {
@@ -215,7 +215,7 @@ class lookup {
215215

216216
let ms = *ty::trait_methods(self.tcx(), did);
217217
for ms.eachi |i, m| {
218-
if m.ident != self.m_name { cont; }
218+
if m.ident != self.m_name { again; }
219219

220220
let m_fty = ty::mk_fn(self.tcx(), m.fty);
221221

@@ -251,7 +251,7 @@ class lookup {
251251
let ms = *ty::trait_methods(self.tcx(), did);
252252

253253
for ms.each |m| {
254-
if m.ident != self.m_name { cont; }
254+
if m.ident != self.m_name { again; }
255255

256256
if m.vis == ast::private && !self.include_private {
257257
self.tcx().sess.span_fatal(

src/rustc/middle/typeck/check/vtable.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ fn lookup_vtable(fcx: @fn_ctxt, isc: resolve::iscopes, sp: span,
119119
// find the trait that im implements (if any)
120120
let of_ty = alt ty::impl_trait(tcx, im.did) {
121121
some(of_ty) { of_ty }
122-
_ { cont; }
122+
_ { again; }
123123
};
124124

125125
// it must have the same id as the expected one
126126
alt ty::get(of_ty).struct {
127-
ty::ty_trait(id, _) if id != trait_id { cont; }
127+
ty::ty_trait(id, _) if id != trait_id { again; }
128128
_ { /* ok */ }
129129
}
130130

@@ -134,7 +134,7 @@ fn lookup_vtable(fcx: @fn_ctxt, isc: resolve::iscopes, sp: span,
134134
impl_self_ty(fcx, im.did);
135135
let im_bs = ty::lookup_item_type(tcx, im.did).bounds;
136136
alt fcx.mk_subty(ty, for_ty) {
137-
result::err(_) { cont; }
137+
result::err(_) { again; }
138138
result::ok(()) { }
139139
}
140140

src/rustdoc/reexport_pass.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ fn build_reexport_path_map(srv: astsrv::srv, -def_map: def_map) -> path_map {
184184

185185
let mut reexportdocs = ~[];
186186
for defs.each |def| {
187-
if !def.reexp { cont; }
187+
if !def.reexp { again; }
188188
alt def_map.find(def.id) {
189189
some(itemtag) {
190190
reexportdocs += ~[(*name, itemtag)];

src/test/bench/shootout-k-nucleotide-pipes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn main(args: ~[str]) {
207207
while !rdr.eof() {
208208
let line: str = rdr.read_line();
209209

210-
if str::len(line) == 0u { cont; }
210+
if str::len(line) == 0u { again; }
211211

212212
alt (line[0], proc_mode) {
213213

src/test/bench/shootout-k-nucleotide.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ fn main(args: ~[str]) {
155155
while !rdr.eof() {
156156
let line: str = rdr.read_line();
157157

158-
if str::len(line) == 0u { cont; }
158+
if str::len(line) == 0u { again; }
159159

160160
alt (line[0], proc_mode) {
161161

src/test/run-pass/break.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ fn main() {
1010
if x == 3 { break; } assert (x <= 3);
1111
}
1212
i = 0;
13-
while i < 10 { i += 1; if i % 2 == 0 { cont; } assert (i % 2 != 0); }
13+
while i < 10 { i += 1; if i % 2 == 0 { again; } assert (i % 2 != 0); }
1414
i = 0;
1515
loop {
16-
i += 1; if i % 2 == 0 { cont; } assert (i % 2 != 0);
16+
i += 1; if i % 2 == 0 { again; } assert (i % 2 != 0);
1717
if i >= 10 { break; }
1818
}
1919
for vec::each(~[1, 2, 3, 4, 5, 6]) |x| {
20-
if x % 2 == 0 { cont; }
20+
if x % 2 == 0 { again; }
2121
assert (x % 2 != 0);
2222
}
2323
}

src/test/run-pass/class-impl-parameterized-iface.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class cat : map<int, bool> {
5555
}
5656
}
5757
fn each_key(&&f: fn(&&int) -> bool) {
58-
for self.each |k, _v| { if !f(k) { break; } cont;};
58+
for self.each |k, _v| { if !f(k) { break; } again;};
5959
}
6060
fn each_value(&&f: fn(&&bool) -> bool) {
61-
for self.each |_k, v| { if !f(v) { break; } cont;};
61+
for self.each |_k, v| { if !f(v) { break; } again;};
6262
}
6363
}
6464

src/test/run-pass/class-impl-very-parameterized-iface.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ class cat<T: copy> : map<int, T> {
7777
}
7878

7979
fn each_key(&&f: fn(&&int) -> bool) {
80-
for self.each |k, _v| { if !f(k) { break; } cont;};
80+
for self.each |k, _v| { if !f(k) { break; } again;};
8181
}
8282
fn each_value(&&f: fn(&&T) -> bool) {
83-
for self.each |_k, v| { if !f(v) { break; } cont;};
83+
for self.each |_k, v| { if !f(v) { break; } again;};
8484
}
8585
}
8686

src/test/run-pass/loop-break-cont.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn main() {
1717
is_even = false;
1818
i += 1u;
1919
if i % 2u != 0u {
20-
cont;
20+
again;
2121
}
2222
is_even = true;
2323
}
@@ -30,7 +30,7 @@ fn main() {
3030
is_even = false;
3131
i += 1u;
3232
if i % 2u != 0u {
33-
cont;
33+
again;
3434
}
3535
is_even = true;
3636
}

src/test/run-pass/ret-break-cont-in-block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn main() {
4040
for vec::all(~[1, 2, 3, 4, 5, 6, 7]) |e| {
4141
last = e;
4242
if e == 5 { break; }
43-
if e % 2 == 1 { cont; }
43+
if e % 2 == 1 { again; }
4444
assert e % 2 == 0;
4545
};
4646
assert last == 5;

src/test/run-pass/terminate-in-initializer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std;
66

77
fn test_break() { loop { let x: @int = break; } }
88

9-
fn test_cont() { let mut i = 0; while i < 1 { i += 1; let x: @int = cont; } }
9+
fn test_cont() { let mut i = 0; while i < 1 { i += 1; let x: @int = again; } }
1010

1111
fn test_ret() { let x: @int = ret; }
1212

src/test/run-pass/while-cont.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ fn main() {
55
assert (i > 0);
66
log(debug, i);
77
i -= 1;
8-
cont;
8+
again;
99
}
1010
}

0 commit comments

Comments
 (0)