From 97ed871fc15acee89a1d8606763b5ed5d885546a Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 19 Jan 2012 15:56:54 -0800 Subject: [PATCH] libcore: "tag" -> "enum" --- src/libcore/comm.rs | 4 ++-- src/libcore/core.rs | 2 +- src/libcore/ctypes.rs | 2 +- src/libcore/either.rs | 2 +- src/libcore/extfmt.rs | 20 ++++++++++---------- src/libcore/option.rs | 2 +- src/libcore/result.rs | 2 +- src/libcore/sys.rs | 2 +- src/libcore/task.rs | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/libcore/comm.rs b/src/libcore/comm.rs index 98d49083f9da..95a62be3dcba 100644 --- a/src/libcore/comm.rs +++ b/src/libcore/comm.rs @@ -64,7 +64,7 @@ type port_id = int; Channels may be duplicated and themselves transmitted \ over other channels." )] -tag chan { +enum chan { chan_t(task::task, port_id); } @@ -89,7 +89,7 @@ resource port_ptr(po: *rustrt::rust_port) { copied, both copies refer to the same port. \ Ports may be associated with multiple s." )] -tag port { port_t(@port_ptr); } +enum port { port_t(@port_ptr); } #[doc( brief = "Sends data over a channel. The sent data is moved \ diff --git a/src/libcore/core.rs b/src/libcore/core.rs index edca071e2d44..1e48890cfff3 100644 --- a/src/libcore/core.rs +++ b/src/libcore/core.rs @@ -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; diff --git a/src/libcore/ctypes.rs b/src/libcore/ctypes.rs index 38ca8ac2a0c3..f928f5d18632 100644 --- a/src/libcore/ctypes.rs +++ b/src/libcore/ctypes.rs @@ -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); diff --git a/src/libcore/either.rs b/src/libcore/either.rs index 47878ae9bf48..578f21cbe5c4 100644 --- a/src/libcore/either.rs +++ b/src/libcore/either.rs @@ -10,7 +10,7 @@ Tag: t The either type */ -tag t { +enum t { /* Variant: left */ left(T); /* Variant: right */ diff --git a/src/libcore/extfmt.rs b/src/libcore/extfmt.rs index 9e97c1133593..8a69a3c80704 100644 --- a/src/libcore/extfmt.rs +++ b/src/libcore/extfmt.rs @@ -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 { diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 89d1171e1d6b..d45bda93dbba 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -12,7 +12,7 @@ Tag: t The option type */ -tag t { +enum t { /* Variant: none */ none; /* Variant: some */ diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 7cb24a7d3d31..cbfe7b1b4658 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -11,7 +11,7 @@ Tag: t The result type */ -tag t { +enum t { /* Variant: ok diff --git a/src/libcore/sys.rs b/src/libcore/sys.rs index 2d516fbeea39..a09964498550 100644 --- a/src/libcore/sys.rs +++ b/src/libcore/sys.rs @@ -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 diff --git a/src/libcore/task.rs b/src/libcore/task.rs index e56153e54eca..a1ed59d3e436 100644 --- a/src/libcore/task.rs +++ b/src/libcore/task.rs @@ -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); }