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(
// 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
// 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] {
// 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
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 {
*/
enum t<T> {
/* Variant: none */
- none;
+ none,
/* Variant: some */
- some(T);
+ some(T),
}
/* Section: Operations */
*/
enum task_result {
/* Variant: tr_success */
- tr_success;
+ tr_success,
/* Variant: tr_failure */
- tr_failure;
+ tr_failure,
}
/*
*/
enum task_notification {
/* Variant: exit */
- exit(task, task_result);
+ exit(task, task_result),
}
/*
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};
// 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
// 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] {
// 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
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 {
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
ret {name: mkname(name), hasarg: yes, occur: multi};
}
-enum optval { val(str); given; }
+enum optval { val(str), given, }
/*
Type: match
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),
}
/*
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) {
// 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.
// Writing
-enum fileflag { append; create; truncate; none; }
+enum fileflag { append, create, truncate, none, }
// FIXME: Seekable really should be orthogonal.
// FIXME: eventually u64
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,
}
*/
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,
}
/*
*/
enum list<T> {
/* Variant: cons */
- cons(T, @list<T>);
+ cons(T, @list<T>),
/* Variant: nil */
- nil;
+ nil,
}
/*Section: Operations */
An IPv4 address
*/
- ipv4(u8, u8, u8, u8);
+ ipv4(u8, u8, u8, u8),
}
/* Section: Operations */
content - A non-empty rope
*/
enum root {
- empty;
- content(@node);
+ empty,
+ content(@node),
}
/*
concat - The concatenation of two ropes
*/
enum node {
- leaf(leaf);
- concat(concat);
+ leaf(leaf),
+ concat(concat),
}
/*
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,
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);