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 \
over other channels."
)]
tag chan<T: send> {
enum chan<T: send> {
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. \
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(
brief = "Sends data over a channel. The sent data is moved \

View File

@ -1,7 +1,7 @@
// Top-level, visible-everywhere definitions.
// 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 = option::t;

View File

@ -72,7 +72,7 @@ type uint32_t = u32;
but using pointers to this type when interoperating \
with C void pointers can help in documentation."
)]
tag void {
enum void {
// Making the only variant reference itself makes it impossible to
// construct. Not exporting it makes it impossible to destructure.
void_private(@void);

View File

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

View File

@ -39,9 +39,9 @@ import option::{some, none};
// Functions used by the fmt extension at compile time
mod ct {
tag signedness { signed; unsigned; }
tag caseness { case_upper; case_lower; }
tag ty {
enum signedness { signed; unsigned; }
enum caseness { case_upper; case_lower; }
enum ty {
ty_bool;
ty_str;
ty_char;
@ -53,14 +53,14 @@ mod ct {
ty_poly;
// FIXME: More types
}
tag flag {
enum flag {
flag_left_justify;
flag_left_zero_pad;
flag_space_for_sign;
flag_sign_always;
flag_alternate;
}
tag count {
enum count {
count_is(int);
count_is_param(int);
count_is_next_param;
@ -77,7 +77,7 @@ mod ct {
// 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) -> ! ;
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
// implement it this way, I think.
mod rt {
tag flag {
enum flag {
flag_left_justify;
flag_left_zero_pad;
flag_space_for_sign;
@ -276,8 +276,8 @@ mod rt {
// comments in front::extfmt::make_flags
flag_none;
}
tag count { count_is(int); count_implied; }
tag 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);
}
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 {
let uwidth;
alt cv.width {

View File

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

View File

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

View File

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

View File

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