lib: ";" to "," in enums

This commit is contained in:
Patrick Walton 2012-01-19 17:55:34 -08:00
parent 874390831a
commit 194d8e3bd5
13 changed files with 104 additions and 104 deletions

View File

@ -75,9 +75,9 @@ type uint32_t = u32;
enum void {
// Making the only variant reference itself makes it impossible to
// construct. Not exporting it makes it impossible to destructure.
void_private(@void);
void_private(@void),
// FIXME: #881
void_private2(@void);
void_private2(@void),
}
#[doc(

View File

@ -39,32 +39,32 @@ import option::{some, none};
// Functions used by the fmt extension at compile time
mod ct {
enum signedness { signed; unsigned; }
enum caseness { case_upper; case_lower; }
enum signedness { signed, unsigned, }
enum caseness { case_upper, case_lower, }
enum ty {
ty_bool;
ty_str;
ty_char;
ty_int(signedness);
ty_bits;
ty_hex(caseness);
ty_octal;
ty_float;
ty_poly;
ty_bool,
ty_str,
ty_char,
ty_int(signedness),
ty_bits,
ty_hex(caseness),
ty_octal,
ty_float,
ty_poly,
// FIXME: More types
}
enum flag {
flag_left_justify;
flag_left_zero_pad;
flag_space_for_sign;
flag_sign_always;
flag_alternate;
flag_left_justify,
flag_left_zero_pad,
flag_space_for_sign,
flag_sign_always,
flag_alternate,
}
enum count {
count_is(int);
count_is_param(int);
count_is_next_param;
count_implied;
count_is(int),
count_is_param(int),
count_is_next_param,
count_implied,
}
// A formatted conversion from an expression to a string
@ -77,7 +77,7 @@ mod ct {
// A fragment of the output sequence
enum piece { piece_string(str); piece_conv(conv); }
enum piece { piece_string(str), piece_conv(conv), }
type error_fn = fn@(str) -> ! ;
fn parse_fmt_string(s: str, error: error_fn) -> [piece] {
@ -264,20 +264,20 @@ mod ct {
// implement it this way, I think.
mod rt {
enum flag {
flag_left_justify;
flag_left_zero_pad;
flag_space_for_sign;
flag_sign_always;
flag_alternate;
flag_left_justify,
flag_left_zero_pad,
flag_space_for_sign,
flag_sign_always,
flag_alternate,
// FIXME: This is a hack to avoid creating 0-length vec exprs,
// which have some difficulty typechecking currently. See
// comments in front::extfmt::make_flags
flag_none;
flag_none,
}
enum count { count_is(int); count_implied; }
enum ty { ty_default; ty_bits; ty_hex_upper; ty_hex_lower; ty_octal; }
enum count { count_is(int), count_implied, }
enum ty { ty_default, ty_bits, ty_hex_upper, ty_hex_lower, ty_octal, }
// FIXME: May not want to use a vector here for flags;
// instead just use a bool per flag
@ -391,7 +391,7 @@ mod rt {
ret str::unsafe_from_bytes(svec);
}
enum pad_mode { pad_signed; pad_unsigned; pad_nozero; }
enum pad_mode { pad_signed, pad_unsigned, pad_nozero, }
fn pad(cv: conv, s: str, mode: pad_mode) -> str {
let uwidth;
alt cv.width {

View File

@ -14,9 +14,9 @@ The option type
*/
enum t<T> {
/* Variant: none */
none;
none,
/* Variant: some */
some(T);
some(T),
}
/* Section: Operations */

View File

@ -181,9 +181,9 @@ Indicates the manner in which a task exited
*/
enum task_result {
/* Variant: tr_success */
tr_success;
tr_success,
/* Variant: tr_failure */
tr_failure;
tr_failure,
}
/*
@ -193,7 +193,7 @@ Message sent upon task exit to indicate normal or abnormal termination
*/
enum task_notification {
/* Variant: exit */
exit(task, task_result);
exit(task, task_result),
}
/*

View File

@ -241,10 +241,10 @@ mod tests {
assert (e(deq.get(3), d));
}
enum taggy { one(int); two(int, int); three(int, int, int); }
enum taggy { one(int), two(int, int), three(int, int, int), }
enum taggypar<T> {
onepar(int); twopar(int, int); threepar(int, int, int);
onepar(int), twopar(int, int), threepar(int, int, int),
}
type reccy = {x: int, y: int, t: taggy};

View File

@ -39,31 +39,31 @@ import option::{some, none};
// Functions used by the fmt extension at compile time
mod ct {
enum signedness { signed; unsigned; }
enum caseness { case_upper; case_lower; }
enum signedness { signed, unsigned, }
enum caseness { case_upper, case_lower, }
enum ty {
ty_bool;
ty_str;
ty_char;
ty_int(signedness);
ty_bits;
ty_hex(caseness);
ty_octal;
ty_float;
ty_bool,
ty_str,
ty_char,
ty_int(signedness),
ty_bits,
ty_hex(caseness),
ty_octal,
ty_float,
// FIXME: More types
}
enum flag {
flag_left_justify;
flag_left_zero_pad;
flag_space_for_sign;
flag_sign_always;
flag_alternate;
flag_left_justify,
flag_left_zero_pad,
flag_space_for_sign,
flag_sign_always,
flag_alternate,
}
enum count {
count_is(int);
count_is_param(int);
count_is_next_param;
count_implied;
count_is(int),
count_is_param(int),
count_is_next_param,
count_implied,
}
// A formatted conversion from an expression to a string
@ -76,7 +76,7 @@ mod ct {
// A fragment of the output sequence
enum piece { piece_string(str); piece_conv(conv); }
enum piece { piece_string(str), piece_conv(conv), }
type error_fn = fn@(str) -> ! ;
fn parse_fmt_string(s: str, error: error_fn) -> [piece] {
@ -261,20 +261,20 @@ mod ct {
// implement it this way, I think.
mod rt {
enum flag {
flag_left_justify;
flag_left_zero_pad;
flag_space_for_sign;
flag_sign_always;
flag_alternate;
flag_left_justify,
flag_left_zero_pad,
flag_space_for_sign,
flag_sign_always,
flag_alternate,
// FIXME: This is a hack to avoid creating 0-length vec exprs,
// which have some difficulty typechecking currently. See
// comments in front::extfmt::make_flags
flag_none;
flag_none,
}
enum count { count_is(int); count_implied; }
enum ty { ty_default; ty_bits; ty_hex_upper; ty_hex_lower; ty_octal; }
enum count { count_is(int), count_implied, }
enum ty { ty_default, ty_bits, ty_hex_upper, ty_hex_lower, ty_octal, }
// FIXME: May not want to use a vector here for flags;
// instead just use a bool per flag
@ -384,7 +384,7 @@ mod rt {
ret str::unsafe_from_bytes(svec);
}
enum pad_mode { pad_signed; pad_unsigned; pad_nozero; }
enum pad_mode { pad_signed, pad_unsigned, pad_nozero, }
fn pad(cv: conv, s: str, mode: pad_mode) -> str {
let uwidth;
alt cv.width {

View File

@ -65,11 +65,11 @@ export opt_strs;
export opt_maybe_str;
export opt_default;
enum name { long(str); short(char); }
enum name { long(str), short(char), }
enum hasarg { yes; no; maybe; }
enum hasarg { yes, no, maybe, }
enum occur { req; optional; multi; }
enum occur { req, optional, multi, }
/*
Type: opt
@ -130,7 +130,7 @@ fn optmulti(name: str) -> opt {
ret {name: mkname(name), hasarg: yes, occur: multi};
}
enum optval { val(str); given; }
enum optval { val(str), given, }
/*
Type: match
@ -159,11 +159,11 @@ The type returned when the command line does not conform to the
expected format. Pass this value to <fail_str> to get an error message.
*/
enum fail_ {
argument_missing(str);
unrecognized_option(str);
option_missing(str);
option_duplicated(str);
unexpected_argument(str);
argument_missing(str),
unrecognized_option(str),
option_missing(str),
option_duplicated(str),
unexpected_argument(str),
}
/*
@ -382,11 +382,11 @@ mod tests {
import result::{err, ok};
enum fail_type {
argument_missing_;
unrecognized_option_;
option_missing_;
option_duplicated_;
unexpected_argument_;
argument_missing_,
unrecognized_option_,
option_missing_,
option_duplicated_,
unexpected_argument_,
}
fn check_fail_type(f: fail_, ft: fail_type) {

View File

@ -17,7 +17,7 @@ native mod rustrt {
// Reading
// FIXME This is all buffered. We might need an unbuffered variant as well
enum seek_style { seek_set; seek_end; seek_cur; }
enum seek_style { seek_set, seek_end, seek_cur, }
// The raw underlying reader iface. All readers must implement this.
@ -264,7 +264,7 @@ fn string_reader(s: str) -> reader {
// Writing
enum fileflag { append; create; truncate; none; }
enum fileflag { append, create, truncate, none, }
// FIXME: Seekable really should be orthogonal.
// FIXME: eventually u64
@ -497,15 +497,15 @@ mod fsync {
enum level {
// whatever fsync does on that platform
fsync;
fsync,
// fdatasync on linux, similiar or more on other platforms
fdatasync;
fdatasync,
// full fsync
//
// You must additionally sync the parent directory as well!
fullfsync;
fullfsync,
}

View File

@ -25,17 +25,17 @@ Represents a json value.
*/
enum json {
/* Variant: num */
num(float);
num(float),
/* Variant: string */
string(str);
string(str),
/* Variant: boolean */
boolean(bool);
boolean(bool),
/* Variant: list */
list(@[json]);
list(@[json]),
/* Variant: dict */
dict(map::map<str,json>);
dict(map::map<str,json>),
/* Variant: null */
null;
null,
}
/*

View File

@ -15,9 +15,9 @@ Tag: list
*/
enum list<T> {
/* Variant: cons */
cons(T, @list<T>);
cons(T, @list<T>),
/* Variant: nil */
nil;
nil,
}
/*Section: Operations */

View File

@ -18,7 +18,7 @@ enum ip_addr {
An IPv4 address
*/
ipv4(u8, u8, u8, u8);
ipv4(u8, u8, u8, u8),
}
/* Section: Operations */

View File

@ -586,8 +586,8 @@ mod node {
content - A non-empty rope
*/
enum root {
empty;
content(@node);
empty,
content(@node),
}
/*
@ -689,8 +689,8 @@ mod node {
concat - The concatenation of two ropes
*/
enum node {
leaf(leaf);
concat(concat);
leaf(leaf),
concat(concat),
}
/*

View File

@ -83,7 +83,7 @@ fn parse_opts(args: [str]) : vec::is_not_empty(args) -> opt_res {
ret either::left(test_opts);
}
enum test_result { tr_ok; tr_failed; tr_ignored; }
enum test_result { tr_ok, tr_failed, tr_ignored, }
// A simple console test runner
fn run_tests_console(opts: test_opts,
@ -186,9 +186,9 @@ fn run_tests_console(opts: test_opts,
fn use_color() -> bool { ret get_concurrency() == 1u; }
enum testevent {
te_filtered([test_desc]);
te_wait(test_desc);
te_result(test_desc, test_result);
te_filtered([test_desc]),
te_wait(test_desc),
te_result(test_desc, test_result),
}
type monitor_msg = (test_desc, test_result);