libcore: "tag" -> "enum"

This commit is contained in:
Patrick Walton
2012-01-19 15:56:54 -08:00
parent c5a407b11b
commit 97ed871fc1
9 changed files with 20 additions and 20 deletions

View File

@@ -64,7 +64,7 @@ type port_id = int;
Channels may be duplicated and themselves transmitted \ Channels may be duplicated and themselves transmitted \
over other channels." over other channels."
)] )]
tag chan<T: send> { enum chan<T: send> {
chan_t(task::task, port_id); chan_t(task::task, port_id);
} }
@@ -89,7 +89,7 @@ resource port_ptr<T: send>(po: *rustrt::rust_port) {
copied, both copies refer to the same port. \ copied, both copies refer to the same port. \
Ports may be associated with multiple <chan>s." Ports may be associated with multiple <chan>s."
)] )]
tag port<T: send> { port_t(@port_ptr<T>); } enum port<T: send> { port_t(@port_ptr<T>); }
#[doc( #[doc(
brief = "Sends data over a channel. The sent data is moved \ brief = "Sends data over a channel. The sent data is moved \

View File

@@ -1,7 +1,7 @@
// Top-level, visible-everywhere definitions. // Top-level, visible-everywhere definitions.
// Export type option as a synonym for option::t and export the some and none // Export type option as a synonym for option::t and export the some and none
// tag constructors. // enum constructors.
import option::{some, none}; import option::{some, none};
import option = option::t; import option = option::t;

View File

@@ -72,7 +72,7 @@ type uint32_t = u32;
but using pointers to this type when interoperating \ but using pointers to this type when interoperating \
with C void pointers can help in documentation." with C void pointers can help in documentation."
)] )]
tag 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);

View File

@@ -10,7 +10,7 @@ Tag: t
The either type The either type
*/ */
tag t<T, U> { enum t<T, U> {
/* Variant: left */ /* Variant: left */
left(T); left(T);
/* Variant: right */ /* Variant: right */

View File

@@ -39,9 +39,9 @@ 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 {
tag signedness { signed; unsigned; } enum signedness { signed; unsigned; }
tag caseness { case_upper; case_lower; } enum caseness { case_upper; case_lower; }
tag ty { enum ty {
ty_bool; ty_bool;
ty_str; ty_str;
ty_char; ty_char;
@@ -53,14 +53,14 @@ mod ct {
ty_poly; ty_poly;
// FIXME: More types // FIXME: More types
} }
tag 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;
} }
tag 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;
@@ -77,7 +77,7 @@ mod ct {
// A fragment of the output sequence // A fragment of the output sequence
tag 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] {
@@ -263,7 +263,7 @@ mod ct {
// conditions can be evaluated at compile-time. For now though it's cleaner to // conditions can be evaluated at compile-time. For now though it's cleaner to
// implement it this way, I think. // implement it this way, I think.
mod rt { mod rt {
tag 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;
@@ -276,8 +276,8 @@ mod rt {
// comments in front::extfmt::make_flags // comments in front::extfmt::make_flags
flag_none; flag_none;
} }
tag count { count_is(int); count_implied; } enum count { count_is(int); count_implied; }
tag 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);
} }
tag 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 {

View File

@@ -12,7 +12,7 @@ Tag: t
The option type The option type
*/ */
tag t<T> { enum t<T> {
/* Variant: none */ /* Variant: none */
none; none;
/* Variant: some */ /* Variant: some */

View File

@@ -11,7 +11,7 @@ Tag: t
The result type The result type
*/ */
tag t<T, U> { enum t<T, U> {
/* /*
Variant: ok Variant: ok

View File

@@ -3,7 +3,7 @@ Module: sys
Misc low level stuff Misc low level stuff
*/ */
tag type_desc = { enum type_desc = {
first_param: **ctypes::c_int, first_param: **ctypes::c_int,
size: ctypes::size_t, size: ctypes::size_t,
align: ctypes::size_t align: ctypes::size_t

View File

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