]> git.lizzy.rs Git - rust.git/commitdiff
lib: ";" to "," in enums
authorPatrick Walton <pcwalton@mimiga.net>
Fri, 20 Jan 2012 01:55:34 +0000 (17:55 -0800)
committerPatrick Walton <pcwalton@mimiga.net>
Fri, 20 Jan 2012 02:04:24 +0000 (18:04 -0800)
13 files changed:
src/libcore/ctypes.rs
src/libcore/extfmt.rs
src/libcore/option.rs
src/libcore/task.rs
src/libstd/deque.rs
src/libstd/extfmt.rs
src/libstd/getopts.rs
src/libstd/io.rs
src/libstd/json.rs
src/libstd/list.rs
src/libstd/net.rs
src/libstd/rope.rs
src/libstd/test.rs

index f928f5d18632486dc097a1cf52b50e5dde6a7925..824cef878d91c8ef6c0c9b7924bf84268b698bde 100644 (file)
@@ -75,9 +75,9 @@
 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(
index 8a69a3c80704f7fb6a74d4e0bd5c0bfc533496c3..61b6ec3c1b4f221bbcdbf0085577fcc17f081d36 100644 (file)
 
 // 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 @@ enum count {
 
 
     // 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 @@ fn parse_type(s: str, i: uint, lim: uint, error: error_fn) ->
 // 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 @@ fn str_init_elt(c: char, n_elts: uint) -> str {
 
         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 {
index d45bda93dbba882348f0f1f055c1f6e63fd49e5d..8cba1c84dc0a346c63699c8fd7f380f6441c35f3 100644 (file)
@@ -14,9 +14,9 @@
 */
 enum t<T> {
     /* Variant: none */
-    none;
+    none,
     /* Variant: some */
-    some(T);
+    some(T),
 }
 
 /* Section: Operations */
index a1ed59d3e436ead1541285d9baa357080e85afeb..b56425159533ce43b1774764b997bc27e3c67498 100644 (file)
@@ -181,9 +181,9 @@ fn spawn_joinable(+f: fn~()) -> joinable_task {
 */
 enum task_result {
     /* Variant: tr_success */
-    tr_success;
+    tr_success,
     /* Variant: tr_failure */
-    tr_failure;
+    tr_failure,
 }
 
 /*
@@ -193,7 +193,7 @@ enum task_result {
 */
 enum task_notification {
     /* Variant: exit */
-    exit(task, task_result);
+    exit(task, task_result),
 }
 
 /*
index b5f46732cfc0f092c95942fa3c18fb88a84407fa..5ab9a44cd1a1966d032fde59afa6bfd880e5ad7d 100644 (file)
@@ -241,10 +241,10 @@ fn test_parameterized<T: copy>(e: eqfn<T>, a: T, b: T, c: T, d: T) {
         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};
index 441ff01a3c138329790fd475161f815de3fa487d..a34c1d27f96a7d2f59d4aea5649d66109f95c1ee 100644 (file)
 
 // 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 @@ enum count {
 
 
     // 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 @@ fn parse_type(s: str, i: uint, lim: uint, error: error_fn) ->
 // 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 @@ fn str_init_elt(c: char, n_elts: uint) -> str {
 
         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 {
index 29df5770a17fee4c7fd87200e95d64ee371cc506..6c21ec1330e1ee200bca8249d830118b4afe121f 100644 (file)
 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 @@ fn find_opt(opts: [opt], nm: name) -> option::t<uint> {
 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) {
index eca266ecfa953edad4bb9b49c240338bb4b11bc7..6331e57ea7dbf7dbefe07aa8a0695e677236d448 100644 (file)
@@ -17,7 +17,7 @@
 // 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,
     }
 
 
index 5b7523e03fdf2e1c38b3dfe5e0cee1150961c9cb..0229b4d1b2280cfc2c0a7e36f02cf1af8cb557be 100644 (file)
 */
 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,
 }
 
 /*
index 3286127bb1b05aa1b3063d6f27e32ca6cacbaf44..b05f895c327ae4220887557db7e999fa627c6cae 100644 (file)
@@ -15,9 +15,9 @@
 */
 enum list<T> {
     /* Variant: cons */
-    cons(T, @list<T>);
+    cons(T, @list<T>),
     /* Variant: nil */
-    nil;
+    nil,
 }
 
 /*Section: Operations */
index e73eed27864521ebd001e1186d756eb710eaa04d..706221d95c2c425567e628af3f3e8defad6e5060 100644 (file)
@@ -18,7 +18,7 @@ enum ip_addr {
 
     An IPv4 address
     */
-    ipv4(u8, u8, u8, u8);
+    ipv4(u8, u8, u8, u8),
 }
 
 /* Section: Operations */
index 54d22dde3a2a311731e98e9927f7d017de385823..eb30897b1c06f500529513b981ea658ef97a7c98 100644 (file)
@@ -586,8 +586,8 @@ mod node {
        content - A non-empty rope
     */
     enum root {
-        empty;
-        content(@node);
+        empty,
+        content(@node),
     }
 
     /*
@@ -689,8 +689,8 @@ enum root {
     concat - The concatenation of two ropes
     */
     enum node {
-        leaf(leaf);
-        concat(concat);
+        leaf(leaf),
+        concat(concat),
     }
 
     /*
index 7fc63c015ee574326af51f1fbe1350d8e8553a8a..707e4cf153fb21a61bff36d1ecdb0bb162d31002 100644 (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 write_pretty(out: io::writer, word: str, color: u8, use_color: bool) {
 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);