// range)
enum opt {
lit(@ast::expr),
- var(/* disr val */int, /* variant dids */{tg: def_id, var: def_id});
- range(@ast::expr, @ast::expr);
+ var(/* disr val */int, /* variant dids */{tg: def_id, var: def_id}),
+ range(@ast::expr, @ast::expr)
}
fn opt_eq(a: opt, b: opt) -> bool {
alt (a, b) {
// in the source language. Since these blocks create variable scope, any
// variables created in them that are still live at the end of the block
// must be dropped and cleaned up when the block ends.
- SCOPE_BLOCK;
+ SCOPE_BLOCK,
// A basic block created from the body of a loop. Contains pointers to
// which block to jump to in the case of "continue" or "break", with the
// "continue" block optional, because "while" and "do while" don't support
// "continue" (TODO: is this intentional?)
- LOOP_SCOPE_BLOCK(option::t<@block_ctxt>, @block_ctxt);
+ LOOP_SCOPE_BLOCK(option::t<@block_ctxt>, @block_ctxt),
// A non-scope block is a basic block created as a translation artifact
// from translating code that expresses conditional logic rather than by
// explicit { ... } block structure in the source language. It's called a
// non-scope block because it doesn't introduce a new variable scope.
- NON_SCOPE_BLOCK;
+ NON_SCOPE_BLOCK
}
}
alt p.token {
- token::SEMI | token::COMMA {
+ token::COMMA {
p.bump();
if p.token == token::RBRACE { done = true; }
}
over other channels."
)]
enum chan<T: send> {
- chan_t(task::task, port_id);
+ chan_t(task::task, port_id)
}
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."
)]
-enum 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 \
/* Variant: left */
left(T),
/* Variant: right */
- right(U),
+ right(U)
}
/* Section: Operations */
Contains the error value
*/
- err(U),
+ err(U)
}
/* Section: Operations */
*/
enum t<T> {
- t({ base: *mutable T, len: uint, rsrc: @dtor_res});
+ t({ base: *mutable T, len: uint, rsrc: @dtor_res})
}
resource dtor_res(dtor: option::t<fn@()>) {
// 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,
*/
enum tree_node<K, V> {
empty,
- node(@K, @V, @tree_node<K, V>, @tree_node<K, V>),
+ node(@K, @V, @tree_node<K, V>, @tree_node<K, V>)
}
/* Section: Operations */
enum chain<K, V> {
present(@entry<K, V>),
- absent,
+ absent
}
type t<K, V> = {
enum search_result<K, V> {
not_found,
found_first(uint, @entry<K,V>),
- found_after(@entry<K,V>, @entry<K,V>),
+ found_after(@entry<K,V>, @entry<K,V>)
}
fn search_rem<K: copy, V: copy>(
/*
Tag: tree_node
*/
-enum tree_node<K, V> { empty, node(@K, @V, treemap<K, V>, treemap<K, V>), }
+enum tree_node<K, V> { empty, node(@K, @V, treemap<K, V>, treemap<K, V>) }
/* Section: Operations */
}
enum hlvl {
- h1 = 1;
- h2 = 2;
- h3 = 3;
+ h1 = 1,
+ h2 = 2,
+ h3 = 3
}
fn write_header(ctxt: ctxt, lvl: hlvl, title: str) {
// error-pattern:invalidate reference i
-enum foo { left({mutable x: int}); right(bool); }
+enum foo { left({mutable x: int}), right(bool) }
fn main() {
let x = left({mutable x: 10});
enum maybe_ordered_pair {
- yes({low: int, high: int} : less_than(*.low, *.high));
- no;
+ yes({low: int, high: int} : less_than(*.low, *.high)),
+ no
}
pure fn less_than(x: int, y: int) -> bool { ret x < y; }
fn main() { }