lib: ";" to "," in enums
This commit is contained in:
parent
874390831a
commit
194d8e3bd5
13 changed files with 104 additions and 104 deletions
|
@ -75,9 +75,9 @@ type uint32_t = u32;
|
||||||
enum void {
|
enum void {
|
||||||
// Making the only variant reference itself makes it impossible to
|
// Making the only variant reference itself makes it impossible to
|
||||||
// construct. Not exporting it makes it impossible to destructure.
|
// construct. Not exporting it makes it impossible to destructure.
|
||||||
void_private(@void);
|
void_private(@void),
|
||||||
// FIXME: #881
|
// FIXME: #881
|
||||||
void_private2(@void);
|
void_private2(@void),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(
|
#[doc(
|
||||||
|
|
|
@ -39,32 +39,32 @@ import option::{some, none};
|
||||||
|
|
||||||
// Functions used by the fmt extension at compile time
|
// Functions used by the fmt extension at compile time
|
||||||
mod ct {
|
mod ct {
|
||||||
enum signedness { signed; unsigned; }
|
enum signedness { signed, unsigned, }
|
||||||
enum caseness { case_upper; case_lower; }
|
enum caseness { case_upper, case_lower, }
|
||||||
enum ty {
|
enum ty {
|
||||||
ty_bool;
|
ty_bool,
|
||||||
ty_str;
|
ty_str,
|
||||||
ty_char;
|
ty_char,
|
||||||
ty_int(signedness);
|
ty_int(signedness),
|
||||||
ty_bits;
|
ty_bits,
|
||||||
ty_hex(caseness);
|
ty_hex(caseness),
|
||||||
ty_octal;
|
ty_octal,
|
||||||
ty_float;
|
ty_float,
|
||||||
ty_poly;
|
ty_poly,
|
||||||
// FIXME: More types
|
// FIXME: More types
|
||||||
}
|
}
|
||||||
enum flag {
|
enum flag {
|
||||||
flag_left_justify;
|
flag_left_justify,
|
||||||
flag_left_zero_pad;
|
flag_left_zero_pad,
|
||||||
flag_space_for_sign;
|
flag_space_for_sign,
|
||||||
flag_sign_always;
|
flag_sign_always,
|
||||||
flag_alternate;
|
flag_alternate,
|
||||||
}
|
}
|
||||||
enum count {
|
enum count {
|
||||||
count_is(int);
|
count_is(int),
|
||||||
count_is_param(int);
|
count_is_param(int),
|
||||||
count_is_next_param;
|
count_is_next_param,
|
||||||
count_implied;
|
count_implied,
|
||||||
}
|
}
|
||||||
|
|
||||||
// A formatted conversion from an expression to a string
|
// A formatted conversion from an expression to a string
|
||||||
|
@ -77,7 +77,7 @@ mod ct {
|
||||||
|
|
||||||
|
|
||||||
// A fragment of the output sequence
|
// 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) -> ! ;
|
type error_fn = fn@(str) -> ! ;
|
||||||
|
|
||||||
fn parse_fmt_string(s: str, error: error_fn) -> [piece] {
|
fn parse_fmt_string(s: str, error: error_fn) -> [piece] {
|
||||||
|
@ -264,20 +264,20 @@ mod ct {
|
||||||
// implement it this way, I think.
|
// implement it this way, I think.
|
||||||
mod rt {
|
mod rt {
|
||||||
enum flag {
|
enum flag {
|
||||||
flag_left_justify;
|
flag_left_justify,
|
||||||
flag_left_zero_pad;
|
flag_left_zero_pad,
|
||||||
flag_space_for_sign;
|
flag_space_for_sign,
|
||||||
flag_sign_always;
|
flag_sign_always,
|
||||||
flag_alternate;
|
flag_alternate,
|
||||||
|
|
||||||
|
|
||||||
// FIXME: This is a hack to avoid creating 0-length vec exprs,
|
// FIXME: This is a hack to avoid creating 0-length vec exprs,
|
||||||
// which have some difficulty typechecking currently. See
|
// which have some difficulty typechecking currently. See
|
||||||
// comments in front::extfmt::make_flags
|
// comments in front::extfmt::make_flags
|
||||||
flag_none;
|
flag_none,
|
||||||
}
|
}
|
||||||
enum count { count_is(int); count_implied; }
|
enum count { count_is(int), count_implied, }
|
||||||
enum ty { ty_default; ty_bits; ty_hex_upper; ty_hex_lower; ty_octal; }
|
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;
|
// FIXME: May not want to use a vector here for flags;
|
||||||
// instead just use a bool per flag
|
// instead just use a bool per flag
|
||||||
|
@ -391,7 +391,7 @@ mod rt {
|
||||||
|
|
||||||
ret str::unsafe_from_bytes(svec);
|
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 {
|
fn pad(cv: conv, s: str, mode: pad_mode) -> str {
|
||||||
let uwidth;
|
let uwidth;
|
||||||
alt cv.width {
|
alt cv.width {
|
||||||
|
|
|
@ -14,9 +14,9 @@ The option type
|
||||||
*/
|
*/
|
||||||
enum t<T> {
|
enum t<T> {
|
||||||
/* Variant: none */
|
/* Variant: none */
|
||||||
none;
|
none,
|
||||||
/* Variant: some */
|
/* Variant: some */
|
||||||
some(T);
|
some(T),
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Section: Operations */
|
/* Section: Operations */
|
||||||
|
|
|
@ -181,9 +181,9 @@ Indicates the manner in which a task exited
|
||||||
*/
|
*/
|
||||||
enum task_result {
|
enum task_result {
|
||||||
/* Variant: tr_success */
|
/* Variant: tr_success */
|
||||||
tr_success;
|
tr_success,
|
||||||
/* Variant: tr_failure */
|
/* 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 {
|
enum task_notification {
|
||||||
/* Variant: exit */
|
/* Variant: exit */
|
||||||
exit(task, task_result);
|
exit(task, task_result),
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -241,10 +241,10 @@ mod tests {
|
||||||
assert (e(deq.get(3), d));
|
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> {
|
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};
|
type reccy = {x: int, y: int, t: taggy};
|
||||||
|
|
|
@ -39,31 +39,31 @@ import option::{some, none};
|
||||||
|
|
||||||
// Functions used by the fmt extension at compile time
|
// Functions used by the fmt extension at compile time
|
||||||
mod ct {
|
mod ct {
|
||||||
enum signedness { signed; unsigned; }
|
enum signedness { signed, unsigned, }
|
||||||
enum caseness { case_upper; case_lower; }
|
enum caseness { case_upper, case_lower, }
|
||||||
enum ty {
|
enum ty {
|
||||||
ty_bool;
|
ty_bool,
|
||||||
ty_str;
|
ty_str,
|
||||||
ty_char;
|
ty_char,
|
||||||
ty_int(signedness);
|
ty_int(signedness),
|
||||||
ty_bits;
|
ty_bits,
|
||||||
ty_hex(caseness);
|
ty_hex(caseness),
|
||||||
ty_octal;
|
ty_octal,
|
||||||
ty_float;
|
ty_float,
|
||||||
// FIXME: More types
|
// FIXME: More types
|
||||||
}
|
}
|
||||||
enum flag {
|
enum flag {
|
||||||
flag_left_justify;
|
flag_left_justify,
|
||||||
flag_left_zero_pad;
|
flag_left_zero_pad,
|
||||||
flag_space_for_sign;
|
flag_space_for_sign,
|
||||||
flag_sign_always;
|
flag_sign_always,
|
||||||
flag_alternate;
|
flag_alternate,
|
||||||
}
|
}
|
||||||
enum count {
|
enum count {
|
||||||
count_is(int);
|
count_is(int),
|
||||||
count_is_param(int);
|
count_is_param(int),
|
||||||
count_is_next_param;
|
count_is_next_param,
|
||||||
count_implied;
|
count_implied,
|
||||||
}
|
}
|
||||||
|
|
||||||
// A formatted conversion from an expression to a string
|
// A formatted conversion from an expression to a string
|
||||||
|
@ -76,7 +76,7 @@ mod ct {
|
||||||
|
|
||||||
|
|
||||||
// A fragment of the output sequence
|
// 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) -> ! ;
|
type error_fn = fn@(str) -> ! ;
|
||||||
|
|
||||||
fn parse_fmt_string(s: str, error: error_fn) -> [piece] {
|
fn parse_fmt_string(s: str, error: error_fn) -> [piece] {
|
||||||
|
@ -261,20 +261,20 @@ mod ct {
|
||||||
// implement it this way, I think.
|
// implement it this way, I think.
|
||||||
mod rt {
|
mod rt {
|
||||||
enum flag {
|
enum flag {
|
||||||
flag_left_justify;
|
flag_left_justify,
|
||||||
flag_left_zero_pad;
|
flag_left_zero_pad,
|
||||||
flag_space_for_sign;
|
flag_space_for_sign,
|
||||||
flag_sign_always;
|
flag_sign_always,
|
||||||
flag_alternate;
|
flag_alternate,
|
||||||
|
|
||||||
|
|
||||||
// FIXME: This is a hack to avoid creating 0-length vec exprs,
|
// FIXME: This is a hack to avoid creating 0-length vec exprs,
|
||||||
// which have some difficulty typechecking currently. See
|
// which have some difficulty typechecking currently. See
|
||||||
// comments in front::extfmt::make_flags
|
// comments in front::extfmt::make_flags
|
||||||
flag_none;
|
flag_none,
|
||||||
}
|
}
|
||||||
enum count { count_is(int); count_implied; }
|
enum count { count_is(int), count_implied, }
|
||||||
enum ty { ty_default; ty_bits; ty_hex_upper; ty_hex_lower; ty_octal; }
|
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;
|
// FIXME: May not want to use a vector here for flags;
|
||||||
// instead just use a bool per flag
|
// instead just use a bool per flag
|
||||||
|
@ -384,7 +384,7 @@ mod rt {
|
||||||
|
|
||||||
ret str::unsafe_from_bytes(svec);
|
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 {
|
fn pad(cv: conv, s: str, mode: pad_mode) -> str {
|
||||||
let uwidth;
|
let uwidth;
|
||||||
alt cv.width {
|
alt cv.width {
|
||||||
|
|
|
@ -65,11 +65,11 @@ export opt_strs;
|
||||||
export opt_maybe_str;
|
export opt_maybe_str;
|
||||||
export opt_default;
|
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
|
Type: opt
|
||||||
|
@ -130,7 +130,7 @@ fn optmulti(name: str) -> opt {
|
||||||
ret {name: mkname(name), hasarg: yes, occur: multi};
|
ret {name: mkname(name), hasarg: yes, occur: multi};
|
||||||
}
|
}
|
||||||
|
|
||||||
enum optval { val(str); given; }
|
enum optval { val(str), given, }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Type: match
|
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.
|
expected format. Pass this value to <fail_str> to get an error message.
|
||||||
*/
|
*/
|
||||||
enum fail_ {
|
enum fail_ {
|
||||||
argument_missing(str);
|
argument_missing(str),
|
||||||
unrecognized_option(str);
|
unrecognized_option(str),
|
||||||
option_missing(str);
|
option_missing(str),
|
||||||
option_duplicated(str);
|
option_duplicated(str),
|
||||||
unexpected_argument(str);
|
unexpected_argument(str),
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -382,11 +382,11 @@ mod tests {
|
||||||
import result::{err, ok};
|
import result::{err, ok};
|
||||||
|
|
||||||
enum fail_type {
|
enum fail_type {
|
||||||
argument_missing_;
|
argument_missing_,
|
||||||
unrecognized_option_;
|
unrecognized_option_,
|
||||||
option_missing_;
|
option_missing_,
|
||||||
option_duplicated_;
|
option_duplicated_,
|
||||||
unexpected_argument_;
|
unexpected_argument_,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_fail_type(f: fail_, ft: fail_type) {
|
fn check_fail_type(f: fail_, ft: fail_type) {
|
||||||
|
|
|
@ -17,7 +17,7 @@ native mod rustrt {
|
||||||
// Reading
|
// Reading
|
||||||
|
|
||||||
// FIXME This is all buffered. We might need an unbuffered variant as well
|
// 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.
|
// The raw underlying reader iface. All readers must implement this.
|
||||||
|
@ -264,7 +264,7 @@ fn string_reader(s: str) -> reader {
|
||||||
|
|
||||||
|
|
||||||
// Writing
|
// Writing
|
||||||
enum fileflag { append; create; truncate; none; }
|
enum fileflag { append, create, truncate, none, }
|
||||||
|
|
||||||
// FIXME: Seekable really should be orthogonal.
|
// FIXME: Seekable really should be orthogonal.
|
||||||
// FIXME: eventually u64
|
// FIXME: eventually u64
|
||||||
|
@ -497,15 +497,15 @@ mod fsync {
|
||||||
|
|
||||||
enum level {
|
enum level {
|
||||||
// whatever fsync does on that platform
|
// whatever fsync does on that platform
|
||||||
fsync;
|
fsync,
|
||||||
|
|
||||||
// fdatasync on linux, similiar or more on other platforms
|
// fdatasync on linux, similiar or more on other platforms
|
||||||
fdatasync;
|
fdatasync,
|
||||||
|
|
||||||
// full fsync
|
// full fsync
|
||||||
//
|
//
|
||||||
// You must additionally sync the parent directory as well!
|
// You must additionally sync the parent directory as well!
|
||||||
fullfsync;
|
fullfsync,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,17 +25,17 @@ Represents a json value.
|
||||||
*/
|
*/
|
||||||
enum json {
|
enum json {
|
||||||
/* Variant: num */
|
/* Variant: num */
|
||||||
num(float);
|
num(float),
|
||||||
/* Variant: string */
|
/* Variant: string */
|
||||||
string(str);
|
string(str),
|
||||||
/* Variant: boolean */
|
/* Variant: boolean */
|
||||||
boolean(bool);
|
boolean(bool),
|
||||||
/* Variant: list */
|
/* Variant: list */
|
||||||
list(@[json]);
|
list(@[json]),
|
||||||
/* Variant: dict */
|
/* Variant: dict */
|
||||||
dict(map::map<str,json>);
|
dict(map::map<str,json>),
|
||||||
/* Variant: null */
|
/* Variant: null */
|
||||||
null;
|
null,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -15,9 +15,9 @@ Tag: list
|
||||||
*/
|
*/
|
||||||
enum list<T> {
|
enum list<T> {
|
||||||
/* Variant: cons */
|
/* Variant: cons */
|
||||||
cons(T, @list<T>);
|
cons(T, @list<T>),
|
||||||
/* Variant: nil */
|
/* Variant: nil */
|
||||||
nil;
|
nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Section: Operations */
|
/*Section: Operations */
|
||||||
|
|
|
@ -18,7 +18,7 @@ enum ip_addr {
|
||||||
|
|
||||||
An IPv4 address
|
An IPv4 address
|
||||||
*/
|
*/
|
||||||
ipv4(u8, u8, u8, u8);
|
ipv4(u8, u8, u8, u8),
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Section: Operations */
|
/* Section: Operations */
|
||||||
|
|
|
@ -586,8 +586,8 @@ mod node {
|
||||||
content - A non-empty rope
|
content - A non-empty rope
|
||||||
*/
|
*/
|
||||||
enum root {
|
enum root {
|
||||||
empty;
|
empty,
|
||||||
content(@node);
|
content(@node),
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -689,8 +689,8 @@ mod node {
|
||||||
concat - The concatenation of two ropes
|
concat - The concatenation of two ropes
|
||||||
*/
|
*/
|
||||||
enum node {
|
enum node {
|
||||||
leaf(leaf);
|
leaf(leaf),
|
||||||
concat(concat);
|
concat(concat),
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -83,7 +83,7 @@ fn parse_opts(args: [str]) : vec::is_not_empty(args) -> opt_res {
|
||||||
ret either::left(test_opts);
|
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
|
// A simple console test runner
|
||||||
fn run_tests_console(opts: test_opts,
|
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; }
|
fn use_color() -> bool { ret get_concurrency() == 1u; }
|
||||||
|
|
||||||
enum testevent {
|
enum testevent {
|
||||||
te_filtered([test_desc]);
|
te_filtered([test_desc]),
|
||||||
te_wait(test_desc);
|
te_wait(test_desc),
|
||||||
te_result(test_desc, test_result);
|
te_result(test_desc, test_result),
|
||||||
}
|
}
|
||||||
|
|
||||||
type monitor_msg = (test_desc, test_result);
|
type monitor_msg = (test_desc, test_result);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue