Insert omitted semicolons for statements

This commit is contained in:
Marijn Haverbeke 2011-09-15 09:48:39 +02:00
parent 2bed548d1b
commit 7298b8f4ba
15 changed files with 30 additions and 35 deletions

View File

@ -521,7 +521,7 @@ fn synthesize_crate_attrs(ecx: @encode_ctxt, crate: @crate) -> [attribute] {
}
_ { [attr] }
}
}
};
}
if !found_link_attr { attrs += [synthesize_link_attr(ecx, [])]; }

View File

@ -1240,7 +1240,7 @@ fn mie_span(mie: mod_index_entry) -> span {
fn check_item(e: @env, i: @ast::item, x: (), v: vt<()>) {
fn typaram_names(tps: [ast::ty_param]) -> [ident] {
let x: [ast::ident] = [];
for tp: ast::ty_param in tps { x += [tp.ident] }
for tp: ast::ty_param in tps { x += [tp.ident]; }
ret x;
}
visit::visit_item(i, x, v);

View File

@ -3769,7 +3769,7 @@ fn get_landing_pad(bcx: @block_ctxt) -> BasicBlockRef {
parent_none. {
ret scope_bcx;
}
}
};
}
}
fail;

View File

@ -991,12 +991,11 @@ fn type_kind(cx: ctxt, ty: t) -> ast::kind {
// FIXME: the environment capture mode is not fully encoded
// here yet, leading to weirdness around closure.
ty_fn(proto, _, _, _, _) {
result =
alt proto {
ast::proto_block. { ast::kind_pinned }
ast::proto_closure. { ast::kind_shared }
_ { ast::kind_unique }
}
result = alt proto {
ast::proto_block. { ast::kind_pinned }
ast::proto_closure. { ast::kind_shared }
_ { ast::kind_unique }
};
}
// Those with refcounts-to-inner raise pinned to shared,
// lower unique to shared. Therefore just set result to shared.
@ -1007,7 +1006,7 @@ fn type_kind(cx: ctxt, ty: t) -> ast::kind {
// otherwise pass through their pointee kind.
ty_ptr(tm) | ty_vec(tm) {
let k = type_kind(cx, tm.ty);
if k == ast::kind_pinned { k = ast::kind_shared }
if k == ast::kind_pinned { k = ast::kind_shared; }
result = kind::lower_kind(result, k);
}
// Records lower to the lowest of their members.

View File

@ -492,7 +492,7 @@ mod collect {
fn ty_param_kinds(tps: [ast::ty_param]) -> [ast::kind] {
let k: [ast::kind] = [];
for p: ast::ty_param in tps { k += [p.kind] }
for p: ast::ty_param in tps { k += [p.kind]; }
ret k;
}
@ -2539,8 +2539,7 @@ fn check_constraints(fcx: @fn_ctxt, cs: [@ast::constr], args: [ast::arg]) {
for c: @ast::constr in cs {
c_args = [];
for a: @spanned<ast::fn_constr_arg> in c.node.args {
c_args +=
[
c_args += [
// "base" should not occur in a fn type thing, as of
// yet, b/c we don't allow constraints on the return type
@ -2582,7 +2581,7 @@ fn check_constraints(fcx: @fn_ctxt, cs: [@ast::constr], args: [ast::arg]) {
carg_ident index out of bounds");
}
}
}]
}];
}
let p_op: ast::expr_ = ast::expr_path(c.node.path);
let oper: @ast::expr = @{id: c.node.id, node: p_op, span: c.span};

View File

@ -750,7 +750,7 @@ fn add_new_extension(cx: ext_ctxt, sp: span, arg: @expr,
_body: option::t<str>, clauses: [@clause]) -> @expr {
for c: @clause in clauses {
alt use_selectors_to_bind(c.params, arg) {
some(bindings) { ret transcribe(cx, bindings, c.body) }
some(bindings) { ret transcribe(cx, bindings, c.body); }
none. { cont; }
}
}

View File

@ -612,7 +612,6 @@ fn print_possibly_embedded_block(s: ps, blk: ast::blk, embedded: embed_type,
}
_ { false }
}
true
}
_ { false }
};
@ -1424,7 +1423,7 @@ fn print_ty_fn(s: ps, proto: ast::proto, id: option::t<ast::ident>,
ibox(s, indent_unit);
word_space(s, "->");
if cf == ast::noreturn {
word_nbsp(s, "!")
word_nbsp(s, "!");
} else {
alt cf {
ast::return_ref(mut) { word(s.s, mut ? "&!" : "&"); }

View File

@ -13,7 +13,7 @@ fn either<T, U,
fn lefts<T, U>(eithers: [t<T, U>]) -> [T] {
let result: [T] = [];
for elt: t<T, U> in eithers {
alt elt { left(l) { result += [l] } _ {/* fallthrough */ } }
alt elt { left(l) { result += [l]; } _ {/* fallthrough */ } }
}
ret result;
}
@ -21,7 +21,7 @@ fn lefts<T, U>(eithers: [t<T, U>]) -> [T] {
fn rights<T, U>(eithers: [t<T, U>]) -> [U] {
let result: [U] = [];
for elt: t<T, U> in eithers {
alt elt { right(r) { result += [r] } _ {/* fallthrough */ } }
alt elt { right(r) { result += [r]; } _ {/* fallthrough */ } }
}
ret result;
}
@ -30,7 +30,7 @@ fn partition<T, U>(eithers: [t<T, U>]) -> {lefts: [T], rights: [U]} {
let lefts: [T] = [];
let rights: [U] = [];
for elt: t<T, U> in eithers {
alt elt { left(l) { lefts += [l] } right(r) { rights += [r] } }
alt elt { left(l) { lefts += [l]; } right(r) { rights += [r]; } }
}
ret {lefts: lefts, rights: rights};
}

View File

@ -71,7 +71,7 @@ fn is_whitespace(s: str) -> bool {
let len = char_len(s);
while i < len {
if !char::is_whitespace(char_at(s, i)) { ret false; }
i += 1u
i += 1u;
}
ret true;
}

View File

@ -40,10 +40,10 @@ fn map(filename: [u8], emit: map_reduce::putter<[u8], int>) {
}
}
fn reduce(word: [u8], get: map_reduce::getter<int>) {
fn reduce(_word: [u8], get: map_reduce::getter<int>) {
let count = 0;
while true { alt get() { some(_) { count += 1; } none. { break } } }
while true { alt get() { some(_) { count += 1; } none. { break; } } }
}
mod map_reduce {
@ -93,7 +93,7 @@ mod map_reduce {
ctrl: chan<ctrl_proto<K2, V>>, key: K2, val: V) {
let c;
alt treemap::find(im, key) {
some(_c) { c = _c }
some(_c) { c = _c; }
none. {
let p = port();
send(ctrl, find_reducer(key, chan(p)));
@ -107,7 +107,7 @@ mod map_reduce {
map(input, bind emit(intermediates, ctrl, _, _));
fn finish<~K, ~V>(k: K, v: chan<reduce_proto<V>>) {
fn finish<~K, ~V>(_k: K, v: chan<reduce_proto<V>>) {
send(v, release);
}
treemap::traverse(intermediates, finish);
@ -190,7 +190,7 @@ mod map_reduce {
}
}
fn finish<~K, ~V>(k: K, v: chan<reduce_proto<V>>) { send(v, done); }
fn finish<~K, ~V>(_k: K, v: chan<reduce_proto<V>>) { send(v, done); }
treemap::traverse(reducers, finish);
for t in tasks { task::join(t); }

View File

@ -38,11 +38,10 @@ fn map(filename: str, emit: map_reduce::putter) {
}
}
fn reduce(word: str, get: map_reduce::getter) {
fn reduce(_word: str, get: map_reduce::getter) {
let count = 0;
while true { alt get() { some(_) { count += 1; } none. { break } } }
while true { alt get() { some(_) { count += 1; } none. { break; } } }
}
mod map_reduce {
@ -85,8 +84,7 @@ mod map_reduce {
let c;
alt im.find(key) {
some(_c) {
c = _c
c = _c;
}
none. {
let p = port();

View File

@ -1,2 +1,2 @@
// error-pattern:quux
fn main() { let x: int = do { fail "quux" } while true; }
fn main() { let x: int = do { fail "quux"; } while true; }

View File

@ -2,6 +2,6 @@
fn force(f: fn()) { f() }
fn main() {
let x = 7;
lambda () { log_err x; }
lambda () { log_err x; };
force(lambda () { log_err x; });
}

View File

@ -1 +1 @@
fn main(args: [str]) { for s in args { log s } }
fn main(args: [str]) { for s in args { log s; } }

View File

@ -13,7 +13,7 @@ fn odd() {
}
fn what() {
fn the(x: @mutable bool) { ret while !*x { *x = true }; }
fn the(x: @mutable bool) { ret while !*x { *x = true; }; }
let i = @mutable false;
let dont = bind the(i);
dont();