]> git.lizzy.rs Git - rust.git/commitdiff
rustc: ";" to "," in enums
authorPatrick Walton <pcwalton@mimiga.net>
Fri, 20 Jan 2012 01:56:05 +0000 (17:56 -0800)
committerPatrick Walton <pcwalton@mimiga.net>
Fri, 20 Jan 2012 02:04:25 +0000 (18:04 -0800)
35 files changed:
src/comp/back/link.rs
src/comp/driver/diagnostic.rs
src/comp/driver/driver.rs
src/comp/driver/rustc.rs
src/comp/driver/session.rs
src/comp/metadata/cstore.rs
src/comp/metadata/tyencode.rs
src/comp/middle/alias.rs
src/comp/middle/ast_map.rs
src/comp/middle/capture.rs
src/comp/middle/debuginfo.rs
src/comp/middle/last_use.rs
src/comp/middle/lint.rs
src/comp/middle/mut.rs
src/comp/middle/resolve.rs
src/comp/middle/shape.rs
src/comp/middle/trans.rs
src/comp/middle/trans_alt.rs
src/comp/middle/trans_closure.rs
src/comp/middle/trans_common.rs
src/comp/middle/tstate/auxiliary.rs
src/comp/middle/tstate/tritv.rs
src/comp/middle/ty.rs
src/comp/middle/typeck.rs
src/comp/syntax/ast.rs
src/comp/syntax/ast_util.rs
src/comp/syntax/codemap.rs
src/comp/syntax/ext/base.rs
src/comp/syntax/ext/simplext.rs
src/comp/syntax/parse/lexer.rs
src/comp/syntax/parse/parser.rs
src/comp/syntax/parse/token.rs
src/comp/syntax/print/pp.rs
src/comp/syntax/print/pprust.rs
src/comp/syntax/visit.rs

index 49b6373129145d37e153fd3111e89375d68ca4ad..f8253a0152277d01ac60d852553609e3da14c4ae 100644 (file)
 import util::filesearch;
 
 enum output_type {
-    output_type_none;
-    output_type_bitcode;
-    output_type_assembly;
-    output_type_llvm_assembly;
-    output_type_object;
-    output_type_exe;
+    output_type_none,
+    output_type_bitcode,
+    output_type_assembly,
+    output_type_llvm_assembly,
+    output_type_object,
+    output_type_exe,
 }
 
 fn llvm_err(sess: session, msg: str) unsafe {
index 6011f35ab922187b39be64868f82465e82c109b9..0694a357f1b42f529b16671ed528c1ee9eed871c 100644 (file)
@@ -108,10 +108,10 @@ fn mk_handler(cm: codemap::codemap,
 }
 
 enum level {
-    fatal;
-    error;
-    warning;
-    note;
+    fatal,
+    error,
+    warning,
+    note,
 }
 
 fn diagnosticstr(lvl: level) -> str {
index 7d0d1741918c3245a0626ddc6127a45a3f288512..be303c5aaa07c549032685b69a7e63a6f37a9e7c 100644 (file)
@@ -18,7 +18,7 @@
 import getopts::{optopt, optmulti, optflag, optflagopt, opt_present};
 import back::{x86, x86_64};
 
-enum pp_mode { ppm_normal; ppm_expanded; ppm_typed; ppm_identified; }
+enum pp_mode { ppm_normal, ppm_expanded, ppm_typed, ppm_identified, }
 
 fn default_configuration(sess: session, argv0: str, input: str) ->
    ast::crate_cfg {
@@ -131,11 +131,11 @@ fn spanned<T: copy>(x: T) -> @ast::spanned<T> {
 }
 
 enum compile_upto {
-    cu_parse;
-    cu_expand;
-    cu_typeck;
-    cu_no_trans;
-    cu_everything;
+    cu_parse,
+    cu_expand,
+    cu_typeck,
+    cu_no_trans,
+    cu_everything,
 }
 
 fn compile_upto(sess: session, cfg: ast::crate_cfg,
index 9e6bb565cadfe10cd8372cd9c675f1797f47e475..4ab6b3491ad191e88859388fb3c61f51519ad81e 100644 (file)
@@ -128,8 +128,8 @@ fn run_compiler(args: [str], demitter: diagnostic::emitter) {
 */
 fn monitor(f: fn~(diagnostic::emitter)) {
     enum monitor_msg {
-        fatal;
-        done;
+        fatal,
+        done,
     };
 
     let p = comm::port();
index bef939bb1c8a72e62a9bd994d369c563a64ff608..29da628fa12aa24c640de5baaeaf29b6ba3d99af 100644 (file)
 import back::target_strs;
 import middle::lint;
 
-enum os { os_win32; os_macos; os_linux; os_freebsd; }
+enum os { os_win32, os_macos, os_linux, os_freebsd, }
 
-enum arch { arch_x86; arch_x86_64; arch_arm; }
+enum arch { arch_x86, arch_x86_64, arch_arm, }
 
-enum crate_type { bin_crate; lib_crate; unknown_crate; }
+enum crate_type { bin_crate, lib_crate, unknown_crate, }
 
 type config =
     {os: os,
index 6fb9ac4edb4f9e50372449e7de988a467d097425..44076ab60b89fc28fabadb081916a0edd8f9a0ab 100644 (file)
@@ -40,7 +40,7 @@
 // other modules to access the cstore's private data. This could also be
 // achieved with an obj, but at the expense of a vtable. Not sure if this is a
 // good pattern or not.
-enum cstore { private(cstore_private); }
+enum cstore { private(cstore_private), }
 
 type cstore_private =
     @{metas: map::hashmap<ast::crate_num, crate_metadata>,
index 539d3fad079af1c619f1716774c13b41650d771a..131ca9dd67e51e2ad290f3ed1ad77a92eb570b1f 100644 (file)
@@ -25,7 +25,7 @@
 // Whatever format you choose should not contain pipe characters.
 type ty_abbrev = {pos: uint, len: uint, s: @str};
 
-enum abbrev_ctxt { ac_no_abbrevs; ac_use_abbrevs(hashmap<ty::t, ty_abbrev>); }
+enum abbrev_ctxt { ac_no_abbrevs, ac_use_abbrevs(hashmap<ty::t, ty_abbrev>), }
 
 fn cx_uses_abbrevs(cx: @ctxt) -> bool {
     alt cx.abbrevs {
index adb08f3e563b76eabcdf40a6cfaa97edbd5aa2c7..d2c75bc182e5899509e383569eae5bf8a827aae0 100644 (file)
 // getting input from one, to be more precise). It is a pass that checks
 // whether aliases are used in a safe way.
 
-enum copied { not_allowed; copied; not_copied; }
-enum invalid_reason { overwritten; val_taken; }
+enum copied { not_allowed, copied, not_copied, }
+enum invalid_reason { overwritten, val_taken, }
 type invalid = {reason: invalid_reason,
                 node_id: node_id,
                 sp: span, path: @ast::path};
 
-enum unsafe_ty { contains(ty::t); mut_contains(ty::t); }
+enum unsafe_ty { contains(ty::t), mut_contains(ty::t), }
 
 type binding = @{node_id: node_id,
                  span: span,
@@ -46,7 +46,7 @@ fn mk_binding(cx: ctx, id: node_id, span: span, root_var: option::t<node_id>,
           mutable copied: not_copied};
 }
 
-enum local_info { local(uint); }
+enum local_info { local(uint), }
 
 type copy_map = std::map::hashmap<node_id, ()>;
 type ref_map = std::map::hashmap<node_id, node_id>;
index eeb44ce3a51201f5df68c1e21244e7dc6c60a2c6..58c6bfc29142a66d9c00a3ec3507f9ae3893f623 100644 (file)
@@ -5,15 +5,15 @@
 import syntax::{visit, codemap};
 
 enum ast_node {
-    node_item(@item);
-    node_native_item(@native_item);
-    node_method(@method);
-    node_expr(@expr);
+    node_item(@item),
+    node_native_item(@native_item),
+    node_method(@method),
+    node_expr(@expr),
     // Locals are numbered, because the alias analysis needs to know in which
     // order they are introduced.
-    node_arg(arg, uint);
-    node_local(uint);
-    node_res_ctor(@item);
+    node_arg(arg, uint),
+    node_local(uint),
+    node_res_ctor(@item),
 }
 
 type map = std::map::map<node_id, ast_node>;
index 7d4bd45256e88606d1210e8a3290a38c8150e76e..c32623b30b1e9da71e106ef0cfd15c3d338015c3 100644 (file)
 export cap_ref;
 
 enum capture_mode {
-    cap_copy; //< Copy the value into the closure.
-    cap_move; //< Move the value into the closure.
-    cap_drop; //< Drop value after creating closure.
-    cap_ref;  //< Reference directly from parent stack frame (block fn).
+    cap_copy, //< Copy the value into the closure.
+    cap_move, //< Move the value into the closure.
+    cap_drop, //< Drop value after creating closure.
+    cap_ref,  //< Reference directly from parent stack frame (block fn).
 }
 
 type capture_var = {
index fc56e39b63aaebe784eb56dae9933fc5cb012d62..cfde53fa820b5dca3c07ad95b94df177a887f09f 100644 (file)
@@ -109,14 +109,14 @@ fn update_cache(cache: metadata_cache, mdtag: int, val: debug_metadata) {
 type metadata_cache = hashmap<int, [debug_metadata]>;
 
 enum debug_metadata {
-    file_metadata(@metadata<file_md>);
-    compile_unit_metadata(@metadata<compile_unit_md>);
-    subprogram_metadata(@metadata<subprogram_md>);
-    local_var_metadata(@metadata<local_var_md>);
-    tydesc_metadata(@metadata<tydesc_md>);
-    block_metadata(@metadata<block_md>);
-    argument_metadata(@metadata<argument_md>);
-    retval_metadata(@metadata<retval_md>);
+    file_metadata(@metadata<file_md>),
+    compile_unit_metadata(@metadata<compile_unit_md>),
+    subprogram_metadata(@metadata<subprogram_md>),
+    local_var_metadata(@metadata<local_var_md>),
+    tydesc_metadata(@metadata<tydesc_md>),
+    block_metadata(@metadata<block_md>),
+    argument_metadata(@metadata<argument_md>),
+    retval_metadata(@metadata<retval_md>),
 }
 
 fn cast_safely<T: copy, U>(val: T) -> U unsafe {
index ce860506feb8a385ce231952e4f378bfc8093d6c..60b8bfd9879146d2d797b1edab0d02a5274b759d 100644 (file)
@@ -26,8 +26,8 @@
 // Marks expr_paths that are last uses.
 type last_uses = std::map::hashmap<node_id, ()>;
 
-enum seen { unset; seen(node_id); }
-enum block_type { func; loop; }
+enum seen { unset, seen(node_id), }
+enum block_type { func, loop, }
 
 type set = [{def: node_id, exprs: list<node_id>}];
 type bl = @{type: block_type, mutable second: bool, mutable exits: [set]};
index adbd959b0de12485f50a953b54ccaa66293d9884..e81759061ae75f3bd24b06291ef6cf922291c6f5 100644 (file)
@@ -5,7 +5,7 @@
 type crate_ctxt = {tcx: ty::ctxt};
 
 enum option {
-    ctypes;
+    ctypes,
 }
 
 fn check_ctypes(tcx: ty::ctxt, crate: @ast::crate) {
index 953b430a21b2f8f742e67c9a140b8c9445af99da..f97b1eda673bb54fc4ebc17f6d0a09fdd1b47755 100644 (file)
@@ -5,7 +5,7 @@
 import syntax::ast_util;
 import driver::session::session;
 
-enum deref_t { unbox; field; index; }
+enum deref_t { unbox, field, index, }
 
 type deref = @{mut: bool, kind: deref_t, outer_t: ty::t};
 
@@ -121,7 +121,7 @@ fn check_crate(tcx: ty::ctxt, crate: @crate) -> mut_map {
     ret cx.mut_map;
 }
 
-enum msg { msg_assign; msg_move_out; msg_mut_ref; }
+enum msg { msg_assign, msg_move_out, msg_mut_ref, }
 
 fn mk_err(cx: @ctx, span: syntax::codemap::span, msg: msg, name: str) {
     cx.tcx.sess.span_err(span, alt msg {
index 0f19721d56e119177d14fc5ea882efa2cbf3e4ab..34fb2a86630be180bbb891d132c5e10f0649fbb9 100644 (file)
 // them, storing the resulting def in the AST nodes.
 
 enum scope {
-    scope_crate;
-    scope_item(@ast::item);
-    scope_bare_fn(ast::fn_decl, node_id, [ast::ty_param]);
-    scope_fn_expr(ast::fn_decl, node_id, [ast::ty_param]);
-    scope_native_item(@ast::native_item);
-    scope_loop(@ast::local); // there's only 1 decl per loop.
-    scope_block(ast::blk, @mutable uint, @mutable uint);
-    scope_arm(ast::arm);
-    scope_method(ast::node_id, [ast::ty_param]);
+    scope_crate,
+    scope_item(@ast::item),
+    scope_bare_fn(ast::fn_decl, node_id, [ast::ty_param]),
+    scope_fn_expr(ast::fn_decl, node_id, [ast::ty_param]),
+    scope_native_item(@ast::native_item),
+    scope_loop(@ast::local), // there's only 1 decl per loop.
+    scope_block(ast::blk, @mutable uint, @mutable uint),
+    scope_arm(ast::arm),
+    scope_method(ast::node_id, [ast::ty_param]),
 }
 
 type scopes = list<scope>;
 
 enum import_state {
-    todo(ast::node_id, ast::ident, @[ast::ident], codemap::span, scopes);
-    is_glob(@[ast::ident], scopes, codemap::span);
-    resolving(span);
+    todo(ast::node_id, ast::ident, @[ast::ident], codemap::span, scopes),
+    is_glob(@[ast::ident], scopes, codemap::span),
+    resolving(span),
     resolved(option::t<def>, /* value */
              option::t<def>, /* type */
              option::t<def>, /* module */
              @[@_impl], /* impls */
              /* used for reporting unused import warning */
-             ast::ident, codemap::span);
+             ast::ident, codemap::span),
 }
 
 enum glob_import_state {
-    glob_resolving(span);
+    glob_resolving(span),
     glob_resolved(option::t<def>,  /* value */
                   option::t<def>,  /* type */
-                  option::t<def>); /* module */
+                  option::t<def>), /* module */
 }
 
 type ext_hash = hashmap<{did: def_id, ident: str, ns: namespace}, def>;
@@ -99,11 +99,11 @@ fn eq(v1: key, v2: key) -> bool {
 }
 
 enum mod_index_entry {
-    mie_view_item(@ast::view_item);
-    mie_import_ident(node_id, codemap::span);
-    mie_item(@ast::item);
-    mie_native_item(@ast::native_item);
-    mie_tag_variant(/* enum item */@ast::item, /* variant index */uint);
+    mie_view_item(@ast::view_item),
+    mie_import_ident(node_id, codemap::span),
+    mie_item(@ast::item),
+    mie_native_item(@ast::native_item),
+    mie_tag_variant(/* enum item */@ast::item, /* variant index */uint),
 }
 
 type mod_index = hashmap<ident, list<mod_index_entry>>;
@@ -151,14 +151,14 @@ enum mod_index_entry {
 
 // Used to distinguish between lookups from outside and from inside modules,
 // since export restrictions should only be applied for the former.
-enum dir { inside; outside; }
+enum dir { inside, outside, }
 
 // There are two types of ns_value enum: "definitely a enum";
 // and "any value". This is so that lookup can behave differently
 // when looking up a variable name that's not yet in scope to check
 // if it's already bound to a enum.
-enum namespace { ns_val(ns_value_type); ns_type; ns_module; }
-enum ns_value_type { ns_a_tag; ns_any_value; }
+enum namespace { ns_val(ns_value_type), ns_type, ns_module, }
+enum ns_value_type { ns_a_tag, ns_any_value, }
 
 fn resolve_crate(sess: session, amap: ast_map::map, crate: @ast::crate) ->
    {def_map: def_map, exp_map: exp_map, impl_map: impl_map} {
@@ -749,7 +749,7 @@ fn ns_name(ns: namespace) -> str {
     }
 }
 
-enum ctxt { in_mod(def); in_scope(scopes); }
+enum ctxt { in_mod(def), in_scope(scopes), }
 
 fn unresolved_err(e: env, cx: ctxt, sp: span, name: ident, kind: str) {
     fn find_fn_or_mod_scope(sc: scopes) -> option::t<scope> {
index 0f391f4161a6f1a73df1e554bca4889a1f0f5973..de1dddb923bf5ae258dddb124bb4fd762eb77139 100644 (file)
@@ -230,7 +230,7 @@ fn compute_static_tag_size(ccx: @crate_ctxt, largest_variants: [uint],
     ret {size: max_size, align: max_align};
 }
 
-enum tag_kind { tk_unit; tk_enum; tk_complex; }
+enum tag_kind { tk_unit, tk_enum, tk_complex, }
 
 fn tag_kind(ccx: @crate_ctxt, did: ast::def_id) -> tag_kind {
     let variants = ty::tag_variants(ccx.tcx, did);
index 7435c30c5bf7c98ea3a77ab1a6acee751944cc93..fd81bb72d4870dd24549fb1e6f1edde7a923a3fb 100644 (file)
@@ -1470,7 +1470,7 @@ fn maybe_name_value(cx: @crate_ctxt, v: ValueRef, s: str) {
 
 
 // Used only for creating scalar comparison glue.
-enum scalar_type { nil_type; signed_int; unsigned_int; floating_point; }
+enum scalar_type { nil_type, signed_int, unsigned_int, floating_point, }
 
 
 fn compare_scalar_types(cx: @block_ctxt, lhs: ValueRef, rhs: ValueRef,
@@ -1938,7 +1938,7 @@ fn memmove_ty(bcx: @block_ctxt, dst: ValueRef, src: ValueRef, t: ty::t) ->
     ret call_memmove(bcx, dst, src, llsz).bcx;
 }
 
-enum copy_action { INIT; DROP_EXISTING; }
+enum copy_action { INIT, DROP_EXISTING, }
 
 // These are the types that are passed by pointer.
 fn type_is_structural_or_param(tcx: ty::ctxt, t: ty::t) -> bool {
@@ -2331,9 +2331,9 @@ fn trans_binary(cx: @block_ctxt, op: ast::binop, a: @ast::expr, b: @ast::expr,
 }
 
 enum dest {
-    by_val(@mutable ValueRef);
-    save_in(ValueRef);
-    ignore;
+    by_val(@mutable ValueRef),
+    save_in(ValueRef),
+    ignore,
 }
 
 fn empty_dest_cell() -> @mutable ValueRef {
@@ -2496,17 +2496,17 @@ fn trans_do_while(cx: @block_ctxt, body: ast::blk, cond: @ast::expr) ->
 };
 
 enum lval_kind {
-    temporary; //< Temporary value passed by value if of immediate type
-    owned;     //< Non-temporary value passed by pointer
-    owned_imm; //< Non-temporary value passed by value
+    temporary, //< Temporary value passed by value if of immediate type
+    owned,     //< Non-temporary value passed by pointer
+    owned_imm, //< Non-temporary value passed by value
 }
 type local_var_result = {val: ValueRef, kind: lval_kind};
 type lval_result = {bcx: @block_ctxt, val: ValueRef, kind: lval_kind};
 enum callee_env {
-    null_env;
-    is_closure;
-    self_env(ValueRef);
-    dict_env(ValueRef, ValueRef);
+    null_env,
+    is_closure,
+    self_env(ValueRef),
+    dict_env(ValueRef, ValueRef),
 }
 type lval_maybe_callee = {bcx: @block_ctxt,
                           val: ValueRef,
@@ -2896,7 +2896,7 @@ fn trans_cast(cx: @block_ctxt, e: @ast::expr, id: ast::node_id,
     check (type_has_static_size(ccx, t_out));
     let ll_t_out = type_of(ccx, e.span, t_out);
 
-    enum kind { pointer; integral; float; tag_; other; }
+    enum kind { pointer, integral, float, tag_, other, }
     fn t_kind(tcx: ty::ctxt, t: ty::t) -> kind {
         ret if ty::type_is_fp(tcx, t) {
                 float
@@ -4415,7 +4415,7 @@ fn finish_fn(fcx: @fn_ctxt, lltop: BasicBlockRef) {
     RetVoid(ret_cx);
 }
 
-enum self_arg { impl_self(ty::t); no_self; }
+enum self_arg { impl_self(ty::t), no_self, }
 
 // trans_closure: Builds an LLVM function out of a source function.
 // If the function closes over its environment a closure will be
index f4fb7a1470e9a603eb548ce79f71c91df313aafd..816c82de1e2b4ff47a1b4c0d1852004dbdafbfc6 100644 (file)
@@ -19,7 +19,7 @@
 // An option identifying a branch (either a literal, a enum variant or a
 // range)
 enum opt {
-    lit(@ast::expr);
+    lit(@ast::expr),
     var(/* disr val */int, /* variant dids */{tg: def_id, var: def_id});
     range(@ast::expr, @ast::expr);
 }
@@ -36,8 +36,8 @@ fn opt_eq(a: opt, b: opt) -> bool {
 }
 
 enum opt_result {
-    single_result(result);
-    range_result(result, result);
+    single_result(result),
+    range_result(result, result),
 }
 fn trans_opt(bcx: @block_ctxt, o: opt) -> opt_result {
     let ccx = bcx_ccx(bcx), bcx = bcx;
@@ -473,7 +473,7 @@ fn compile_submatch(bcx: @block_ctxt, m: match, vals: [ValueRef], f: mk_fail,
 
     // Decide what kind of branch we need
     let opts = get_options(ccx, m, col);
-    enum branch_kind { no_branch; single; switch; compare; }
+    enum branch_kind { no_branch, single, switch, compare, }
     let kind = no_branch;
     let test_val = val;
     if vec::len(opts) > 0u {
index 9b864603b0c57481ee791fc4efcb0abf784c7df8..fcfb4f5244ea915e15de0ac4a61981f8ef438525 100644 (file)
 
 enum environment_value {
     // Evaluate expr and store result in env (used for bind).
-    env_expr(@ast::expr);
+    env_expr(@ast::expr),
 
     // Copy the value from this llvm ValueRef into the environment.
-    env_copy(ValueRef, ty::t, lval_kind);
+    env_copy(ValueRef, ty::t, lval_kind),
 
     // Move the value from this llvm ValueRef into the environment.
-    env_move(ValueRef, ty::t, lval_kind);
+    env_move(ValueRef, ty::t, lval_kind),
 
     // Access by reference (used for blocks).
-    env_ref(ValueRef, ty::t, lval_kind);
+    env_ref(ValueRef, ty::t, lval_kind),
 }
 
 fn ev_to_str(ccx: @crate_ctxt, ev: environment_value) -> str {
index 56a8c7016eb89f080d88907710b2a647aaf37d1b..64ac02e31251ed4433f2c7ae93dd693866081938 100644 (file)
@@ -33,9 +33,9 @@ fn new_namegen() -> namegen {
 type derived_tydesc_info = {lltydesc: ValueRef, escapes: bool};
 
 enum tydesc_kind {
-    tk_static; // Static (monomorphic) type descriptor
-    tk_param; // Type parameter.
-    tk_derived; // Derived from a typaram or another derived tydesc.
+    tk_static, // Static (monomorphic) type descriptor
+    tk_param, // Type parameter.
+    tk_derived, // Derived from a typaram or another derived tydesc.
 }
 
 type tydesc_info =
@@ -131,7 +131,7 @@ enum tydesc_kind {
 // Types used for llself.
 type val_self_pair = {v: ValueRef, t: ty::t};
 
-enum local_val { local_mem(ValueRef); local_imm(ValueRef); }
+enum local_val { local_mem(ValueRef), local_imm(ValueRef), }
 
 type fn_ty_param = {desc: ValueRef, dicts: option::t<[ValueRef]>};
 
@@ -243,8 +243,8 @@ enum tydesc_kind {
      lcx: @local_ctxt};
 
 enum cleanup {
-    clean(fn@(@block_ctxt) -> @block_ctxt);
-    clean_temp(ValueRef, fn@(@block_ctxt) -> @block_ctxt);
+    clean(fn@(@block_ctxt) -> @block_ctxt),
+    clean_temp(ValueRef, fn@(@block_ctxt) -> @block_ctxt),
 }
 
 fn add_clean(cx: @block_ctxt, val: ValueRef, ty: ty::t) {
@@ -388,7 +388,7 @@ enum block_kind {
 
 // FIXME: we should be able to use option::t<@block_parent> here but
 // the infinite-enum check in rustboot gets upset.
-enum block_parent { parent_none; parent_some(@block_ctxt); }
+enum block_parent { parent_none, parent_some(@block_ctxt), }
 
 type result = {bcx: @block_ctxt, val: ValueRef};
 type result_t = {bcx: @block_ctxt, val: ValueRef, ty: ty::t};
@@ -886,8 +886,8 @@ fn C_shape(ccx: @crate_ctxt, bytes: [u8]) -> ValueRef {
 
 // Used to identify cached dictionaries
 enum dict_param {
-    dict_param_dict(dict_id);
-    dict_param_ty(ty::t);
+    dict_param_dict(dict_id),
+    dict_param_ty(ty::t),
 }
 type dict_id = @{def: ast::def_id, params: [dict_param]};
 fn hash_dict_id(&&dp: dict_id) -> uint {
index e3a85c41692beef614f545d211745c2ffa0af6fb..c6af04460ff86603c19d1bdc6c33af4f71902244 100644 (file)
 // Used to communicate which operands should be invalidated
 // to helper functions
 enum oper_type {
-    oper_move;
-    oper_swap;
-    oper_assign;
-    oper_assign_op;
-    oper_pure;
+    oper_move,
+    oper_swap,
+    oper_assign,
+    oper_assign_op,
+    oper_pure,
 }
 
 /* logging funs */
@@ -199,11 +199,11 @@ fn print_idents(&idents: [ident]) {
 type constr_arg_use = spanned<constr_arg_general_<inst>>;
 
 enum constraint {
-    cinit(uint, span, ident);
+    cinit(uint, span, ident),
 
     // FIXME: really only want it to be mutable during collect_locals.
     // freeze it after that.
-    cpred(@path, @mutable [pred_args]);
+    cpred(@path, @mutable [pred_args]),
 }
 
 // An ninit variant has a node_id because it refers to a local var.
@@ -212,8 +212,8 @@ enum constraint {
 // FIXME: would be nice to give both a def_id field,
 // and give ninit a constraint saying it's local.
 enum tsconstr {
-    ninit(node_id, ident);
-    npred(@path, def_id, [@constr_arg_use]);
+    ninit(node_id, ident),
+    npred(@path, def_id, [@constr_arg_use]),
 }
 
 type sp_constr = spanned<tsconstr>;
@@ -780,7 +780,7 @@ fn replace(subst: subst, d: pred_args) -> [constr_arg_general_<inst>] {
     ret rslt;
 }
 
-enum if_ty { if_check; plain_if; }
+enum if_ty { if_check, plain_if, }
 
 fn local_node_id_to_def_id_strict(fcx: fn_ctxt, sp: span, i: node_id) ->
    def_id {
index 6bb471390590d899951c95fb234dc999efe2c99b..37cc22edf3b2d5100f7017b7387d1b704246adde 100644 (file)
@@ -30,7 +30,7 @@
 */
 
 type t = {uncertain: bitv::t, val: bitv::t, nbits: uint};
-enum trit { ttrue; tfalse; dont_care; }
+enum trit { ttrue, tfalse, dont_care, }
 
 fn create_tritv(len: uint) -> t {
     ret {uncertain: bitv::create(len, true),
index 9a54c58ab0b10338547111388d6b0ddf20cd2ee0..b7751fc235e04f39f27bfe251650ab181b4ce824 100644 (file)
 type t = uint;
 
 enum closure_kind {
-    ck_any;
-    ck_block;
-    ck_box;
-    ck_uniq;
+    ck_any,
+    ck_block,
+    ck_box,
+    ck_uniq,
 }
 
 type fn_ty = {proto: ast::proto,
@@ -251,34 +251,34 @@ enum closure_kind {
 // NB: If you change this, you'll probably want to change the corresponding
 // AST structure in front/ast::rs as well.
 enum sty {
-    ty_nil;
-    ty_bot;
-    ty_bool;
-    ty_int(ast::int_ty);
-    ty_uint(ast::uint_ty);
-    ty_float(ast::float_ty);
-    ty_str;
-    ty_tag(def_id, [t]);
-    ty_box(mt);
-    ty_uniq(mt);
-    ty_vec(mt);
-    ty_ptr(mt);
-    ty_rec([field]);
-    ty_fn(fn_ty);
-    ty_native_fn([arg], t);
-    ty_iface(def_id, [t]);
-    ty_res(def_id, t, [t]);
-    ty_tup([t]);
-    ty_var(int); // type variable
-
-    ty_param(uint, def_id); // fn/enum type param
-
-    ty_type; // type_desc*
-    ty_send_type; // type_desc* that has been cloned into exchange heap
-    ty_native(def_id);
-    ty_constr(t, [@type_constr]);
-    ty_opaque_closure_ptr(closure_kind); // ptr to env for fn, fn@, fn~
-    ty_named(t, @str);
+    ty_nil,
+    ty_bot,
+    ty_bool,
+    ty_int(ast::int_ty),
+    ty_uint(ast::uint_ty),
+    ty_float(ast::float_ty),
+    ty_str,
+    ty_tag(def_id, [t]),
+    ty_box(mt),
+    ty_uniq(mt),
+    ty_vec(mt),
+    ty_ptr(mt),
+    ty_rec([field]),
+    ty_fn(fn_ty),
+    ty_native_fn([arg], t),
+    ty_iface(def_id, [t]),
+    ty_res(def_id, t, [t]),
+    ty_tup([t]),
+    ty_var(int), // type variable
+
+    ty_param(uint, def_id), // fn/enum type param
+
+    ty_type, // type_desc*
+    ty_send_type, // type_desc* that has been cloned into exchange heap
+    ty_native(def_id),
+    ty_constr(t, [@type_constr]),
+    ty_opaque_closure_ptr(closure_kind), // ptr to env for fn, fn@, fn~
+    ty_named(t, @str),
 }
 
 // In the middle end, constraints have a def_id attached, referring
@@ -289,24 +289,24 @@ enum sty {
 
 // Data structures used in type unification
 enum type_err {
-    terr_mismatch;
-    terr_ret_style_mismatch(ast::ret_style, ast::ret_style);
-    terr_box_mutability;
-    terr_vec_mutability;
-    terr_tuple_size(uint, uint);
-    terr_record_size(uint, uint);
-    terr_record_mutability;
-    terr_record_fields(ast::ident, ast::ident);
-    terr_arg_count;
-    terr_mode_mismatch(mode, mode);
-    terr_constr_len(uint, uint);
-    terr_constr_mismatch(@type_constr, @type_constr);
+    terr_mismatch,
+    terr_ret_style_mismatch(ast::ret_style, ast::ret_style),
+    terr_box_mutability,
+    terr_vec_mutability,
+    terr_tuple_size(uint, uint),
+    terr_record_size(uint, uint),
+    terr_record_mutability,
+    terr_record_fields(ast::ident, ast::ident),
+    terr_arg_count,
+    terr_mode_mismatch(mode, mode),
+    terr_constr_len(uint, uint),
+    terr_constr_mismatch(@type_constr, @type_constr),
 }
 
 enum param_bound {
-    bound_copy;
-    bound_send;
-    bound_iface(t);
+    bound_copy,
+    bound_send,
+    bound_iface(t),
 }
 
 fn param_bounds_to_kind(bounds: param_bounds) -> kind {
@@ -713,9 +713,9 @@ fn walk_ty(cx: ctxt, walker: ty_walk, ty: t) {
 }
 
 enum fold_mode {
-    fm_var(fn@(int) -> t);
-    fm_param(fn@(uint, def_id) -> t);
-    fm_general(fn@(t) -> t);
+    fm_var(fn@(int) -> t),
+    fm_param(fn@(uint, def_id) -> t),
+    fm_general(fn@(t) -> t),
 }
 
 fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t {
@@ -973,7 +973,7 @@ fn type_needs_drop(cx: ctxt, ty: t) -> bool {
     ret result;
 }
 
-enum kind { kind_sendable; kind_copyable; kind_noncopyable; }
+enum kind { kind_sendable, kind_copyable, kind_noncopyable, }
 
 // Using these query functons is preferable to direct comparison or matching
 // against the kind constants, as we may modify the kind hierarchy in the
@@ -1732,18 +1732,18 @@ mod unify {
     export var_bindings;
     export precise, in_bindings;
 
-    enum result { ures_ok(t); ures_err(type_err); }
-    enum union_result { unres_ok; unres_err(type_err); }
+    enum result { ures_ok(t), ures_err(type_err), }
+    enum union_result { unres_ok, unres_err(type_err), }
     enum fixup_result {
-        fix_ok(t); // fixup succeeded
-        fix_err(int); // fixup failed because a type variable was unresolved
+        fix_ok(t), // fixup succeeded
+        fix_err(int), // fixup failed because a type variable was unresolved
     }
     type var_bindings =
         {sets: ufind::ufind, types: smallintmap::smallintmap<t>};
 
     enum unify_style {
-        precise;
-        in_bindings(@var_bindings);
+        precise,
+        in_bindings(@var_bindings),
     }
     type ctxt = {st: unify_style, tcx: ty_ctxt};
 
@@ -2043,11 +2043,11 @@ fn resolve_type_structure(tcx: ty_ctxt, vb: @var_bindings, typ: t) ->
     // Specifies the allowable subtyping between expected and actual types
     enum variance {
         // Actual may be a subtype of expected
-        covariant;
+        covariant,
         // Actual may be a supertype of expected
-        contravariant;
+        contravariant,
         // Actual must be the same type as expected
-        invariant;
+        invariant,
     }
 
     // The calculation for recursive variance
index 15c247bd81b28e613b7c84d5d72c0b9cbf586c7c..cfeddd46050c01a3a26a42573ce042505a1d1e56 100644 (file)
 export dict_map, dict_res, dict_origin, dict_static, dict_param, dict_iface;
 
 enum method_origin {
-    method_static(ast::def_id);
+    method_static(ast::def_id),
     // iface id, method num, param num, bound num
-    method_param(ast::def_id, uint, uint, uint);
-    method_iface(uint);
+    method_param(ast::def_id, uint, uint, uint),
+    method_iface(uint),
 }
 type method_map = hashmap<ast::node_id, method_origin>;
 
 // Resolutions for bounds of all parameters, left to right, for a given path.
 type dict_res = @[dict_origin];
 enum dict_origin {
-    dict_static(ast::def_id, [ty::t], dict_res);
+    dict_static(ast::def_id, [ty::t], dict_res),
     // Param number, bound number
-    dict_param(uint, uint);
-    dict_iface(ast::def_id);
+    dict_param(uint, uint),
+    dict_iface(ast::def_id),
 }
 type dict_map = hashmap<ast::node_id, dict_res>;
 
@@ -45,7 +45,7 @@ enum dict_origin {
 
 // Used for typechecking the methods of an impl
 enum self_info {
-    self_impl(ty::t);
+    self_impl(ty::t),
 }
 
 type crate_ctxt = {mutable self_infos: [self_info],
@@ -231,7 +231,7 @@ fn default_arg_mode_for_ty(tcx: ty::ctxt, m: ast::mode,
     }
 }
 
-enum mode { m_collect; m_check; m_check_tyvar(@fn_ctxt); }
+enum mode { m_collect, m_check, m_check_tyvar(@fn_ctxt), }
 
 fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
     fn getter(tcx: ty::ctxt, mode: mode, id: ast::def_id)
index a01ce73023625e1c82c9ddfd72597a10726c80f1..0f7ba99301f5c6c5b884ea9792d16d7477420a89 100644 (file)
 const crate_node_id: node_id = 0;
 
 enum ty_param_bound {
-    bound_copy;
-    bound_send;
-    bound_iface(@ty);
+    bound_copy,
+    bound_send,
+    bound_iface(@ty),
 }
 
 type ty_param = {ident: ident, id: node_id, bounds: @[ty_param_bound]};
 
 enum def {
-    def_fn(def_id, purity);
-    def_self(def_id);
-    def_mod(def_id);
-    def_native_mod(def_id);
-    def_const(def_id);
-    def_arg(def_id, mode);
-    def_local(def_id, let_style);
-    def_variant(def_id /* enum */, def_id /* variant */);
-    def_ty(def_id);
-    def_ty_param(def_id, uint);
-    def_binding(def_id);
-    def_use(def_id);
-    def_native_ty(def_id);
-    def_native_fn(def_id, purity);
-    def_upvar(def_id, @def, node_id); // node_id == expr_fn or expr_fn_block
+    def_fn(def_id, purity),
+    def_self(def_id),
+    def_mod(def_id),
+    def_native_mod(def_id),
+    def_const(def_id),
+    def_arg(def_id, mode),
+    def_local(def_id, let_style),
+    def_variant(def_id /* enum */, def_id /* variant */),
+    def_ty(def_id),
+    def_ty_param(def_id, uint),
+    def_binding(def_id),
+    def_use(def_id),
+    def_native_ty(def_id),
+    def_native_fn(def_id, purity),
+    def_upvar(def_id, @def, node_id), // node_id == expr_fn or expr_fn_block
 }
 
 // The set of meta_items that define the compilation environment of the crate,
@@ -63,17 +63,17 @@ enum def {
      config: crate_cfg};
 
 enum crate_directive_ {
-    cdir_src_mod(ident, [attribute]);
-    cdir_dir_mod(ident, [@crate_directive], [attribute]);
+    cdir_src_mod(ident, [attribute]),
+    cdir_dir_mod(ident, [@crate_directive], [attribute]),
 
-    // NB: cdir_view_item is *not* processed by the rest of the compiler; the
+    // NB: cdir_view_item is *not* processed by the rest of the compiler, the
     // attached view_items are sunk into the crate's module during parsing,
     // and processed (resolved, imported, etc.) there. This enum-variant
     // exists only to preserve the view items in order in case we decide to
     // pretty-print crates in the future.
-    cdir_view_item(@view_item);
+    cdir_view_item(@view_item),
 
-    cdir_syntax(@path);
+    cdir_syntax(@path),
 }
 
 type crate_directive = spanned<crate_directive_>;
@@ -81,9 +81,9 @@ enum crate_directive_ {
 type meta_item = spanned<meta_item_>;
 
 enum meta_item_ {
-    meta_word(ident);
-    meta_list(ident, [@meta_item]);
-    meta_name_value(ident, lit);
+    meta_word(ident),
+    meta_list(ident, [@meta_item]),
+    meta_name_value(ident, lit),
 }
 
 type blk = spanned<blk_>;
@@ -96,7 +96,7 @@ enum meta_item_ {
 type field_pat = {ident: ident, pat: @pat};
 
 enum pat_ {
-    pat_wild;
+    pat_wild,
     // A pat_ident may either be a new bound variable,
     // or a nullary enum (in which case the second field
     // is none).
@@ -107,24 +107,24 @@ enum pat_ {
     // After the resolution phase, code should never pattern-
     // match on a pat directly! Always call pat_util::normalize_pat --
     // it turns any pat_idents that refer to nullary tags into pat_tags.
-    pat_ident(@path, option::t<@pat>);
-    pat_tag(@path, [@pat]);
-    pat_rec([field_pat], bool);
-    pat_tup([@pat]);
-    pat_box(@pat);
-    pat_uniq(@pat);
-    pat_lit(@expr);
-    pat_range(@expr, @expr);
+    pat_ident(@path, option::t<@pat>),
+    pat_tag(@path, [@pat]),
+    pat_rec([field_pat], bool),
+    pat_tup([@pat]),
+    pat_box(@pat),
+    pat_uniq(@pat),
+    pat_lit(@expr),
+    pat_range(@expr, @expr),
 }
 
-enum mutability { mut; imm; maybe_mut; }
+enum mutability { mut, imm, maybe_mut, }
 
 enum proto {
-    proto_bare;    // native fn
-    proto_any;     // fn
-    proto_uniq;    // fn~
-    proto_box;     // fn@
-    proto_block;   // fn&
+    proto_bare,    // native fn
+    proto_any,     // fn
+    proto_uniq,    // fn~
+    proto_box,     // fn@
+    proto_block,   // fn&
 }
 
 pure fn is_blockish(p: ast::proto) -> bool {
@@ -135,48 +135,48 @@ enum proto {
 }
 
 enum binop {
-    add;
-    subtract;
-    mul;
-    div;
-    rem;
-    and;
-    or;
-    bitxor;
-    bitand;
-    bitor;
-    lsl;
-    lsr;
-    asr;
-    eq;
-    lt;
-    le;
-    ne;
-    ge;
-    gt;
+    add,
+    subtract,
+    mul,
+    div,
+    rem,
+    and,
+    or,
+    bitxor,
+    bitand,
+    bitor,
+    lsl,
+    lsr,
+    asr,
+    eq,
+    lt,
+    le,
+    ne,
+    ge,
+    gt,
 }
 
 enum unop {
-    box(mutability);
-    uniq(mutability);
-    deref; not; neg;
+    box(mutability),
+    uniq(mutability),
+    deref, not, neg,
 }
 
-enum mode { by_ref; by_val; by_mut_ref; by_move; by_copy; mode_infer; }
+enum mode { by_ref, by_val, by_mut_ref, by_move, by_copy, mode_infer, }
 
 type stmt = spanned<stmt_>;
 
 enum stmt_ {
-    stmt_decl(@decl, node_id);
+    stmt_decl(@decl, node_id),
 
     // expr without trailing semi-colon (must have unit type):
-    stmt_expr(@expr, node_id);
+    stmt_expr(@expr, node_id),
 
     // expr with trailing semi-colon (may have any type):
-    stmt_semi(@expr, node_id);
+    stmt_semi(@expr, node_id),
 }
 
-enum init_op { init_assign; init_move; }
+enum init_op { init_assign, init_move, }
 
 type initializer = {op: init_op, expr: @expr};
 
@@ -187,9 +187,9 @@ enum stmt_ {
 
 type decl = spanned<decl_>;
 
-enum let_style { let_copy; let_ref; }
+enum let_style { let_copy, let_ref, }
 
-enum decl_ { decl_local([(let_style, @local)]); decl_item(@item); }
+enum decl_ { decl_local([(let_style, @local)]), decl_item(@item), }
 
 type arm = {pats: [@pat], guard: option::t<@expr>, body: blk};
 
@@ -197,61 +197,61 @@ enum stmt_ {
 
 type field = spanned<field_>;
 
-enum blk_check_mode { default_blk; unchecked_blk; unsafe_blk; }
+enum blk_check_mode { default_blk, unchecked_blk, unsafe_blk, }
 
-enum expr_check_mode { claimed_expr; checked_expr; }
+enum expr_check_mode { claimed_expr, checked_expr, }
 
 type expr = {id: node_id, node: expr_, span: span};
 
 enum expr_ {
-    expr_vec([@expr], mutability);
-    expr_rec([field], option::t<@expr>);
-    expr_call(@expr, [@expr], bool);
-    expr_tup([@expr]);
-    expr_bind(@expr, [option::t<@expr>]);
-    expr_binary(binop, @expr, @expr);
-    expr_unary(unop, @expr);
-    expr_lit(@lit);
-    expr_cast(@expr, @ty);
-    expr_if(@expr, blk, option::t<@expr>);
-    expr_ternary(@expr, @expr, @expr);
-    expr_while(@expr, blk);
-    expr_for(@local, @expr, blk);
-    expr_do_while(blk, @expr);
-    expr_alt(@expr, [arm]);
-    expr_fn(proto, fn_decl, blk, @capture_clause);
-    expr_fn_block(fn_decl, blk);
-    expr_block(blk);
+    expr_vec([@expr], mutability),
+    expr_rec([field], option::t<@expr>),
+    expr_call(@expr, [@expr], bool),
+    expr_tup([@expr]),
+    expr_bind(@expr, [option::t<@expr>]),
+    expr_binary(binop, @expr, @expr),
+    expr_unary(unop, @expr),
+    expr_lit(@lit),
+    expr_cast(@expr, @ty),
+    expr_if(@expr, blk, option::t<@expr>),
+    expr_ternary(@expr, @expr, @expr),
+    expr_while(@expr, blk),
+    expr_for(@local, @expr, blk),
+    expr_do_while(blk, @expr),
+    expr_alt(@expr, [arm]),
+    expr_fn(proto, fn_decl, blk, @capture_clause),
+    expr_fn_block(fn_decl, blk),
+    expr_block(blk),
 
     /*
      * FIXME: many of these @exprs should be constrained with
      * is_lval once we have constrained types working.
      */
-    expr_copy(@expr);
-    expr_move(@expr, @expr);
-    expr_assign(@expr, @expr);
-    expr_swap(@expr, @expr);
-    expr_assign_op(binop, @expr, @expr);
-    expr_field(@expr, ident, [@ty]);
-    expr_index(@expr, @expr);
-    expr_path(@path);
-    expr_fail(option::t<@expr>);
-    expr_break;
-    expr_cont;
-    expr_ret(option::t<@expr>);
-    expr_be(@expr);
-    expr_log(int, @expr, @expr);
+    expr_copy(@expr),
+    expr_move(@expr, @expr),
+    expr_assign(@expr, @expr),
+    expr_swap(@expr, @expr),
+    expr_assign_op(binop, @expr, @expr),
+    expr_field(@expr, ident, [@ty]),
+    expr_index(@expr, @expr),
+    expr_path(@path),
+    expr_fail(option::t<@expr>),
+    expr_break,
+    expr_cont,
+    expr_ret(option::t<@expr>),
+    expr_be(@expr),
+    expr_log(int, @expr, @expr),
 
     /* just an assert, no significance to typestate */
-    expr_assert(@expr);
+    expr_assert(@expr),
 
     /* preds that typestate is aware of */
-    expr_check(expr_check_mode, @expr);
+    expr_check(expr_check_mode, @expr),
 
     /* FIXME Would be nice if expr_check desugared
        to expr_if_check. */
-    expr_if_check(@expr, blk, option::t<@expr>);
-    expr_mac(mac);
+    expr_if_check(@expr, blk, option::t<@expr>),
+    expr_mac(mac),
 }
 
 type capture_item = {
@@ -268,29 +268,29 @@ enum expr_ {
 // Says whether this is a block the user marked as
 // "unchecked"
 enum blk_sort {
-    blk_unchecked; // declared as "exception to effect-checking rules"
-    blk_checked; // all typing rules apply
+    blk_unchecked, // declared as "exception to effect-checking rules"
+    blk_checked, // all typing rules apply
 }
 */
 
 type mac = spanned<mac_>;
 
 enum mac_ {
-    mac_invoc(@path, @expr, option::t<str>);
-    mac_embed_type(@ty);
-    mac_embed_block(blk);
-    mac_ellipsis;
+    mac_invoc(@path, @expr, option::t<str>),
+    mac_embed_type(@ty),
+    mac_embed_block(blk),
+    mac_ellipsis,
 }
 
 type lit = spanned<lit_>;
 
 enum lit_ {
-    lit_str(str);
-    lit_int(i64, int_ty);
-    lit_uint(u64, uint_ty);
-    lit_float(str, float_ty);
-    lit_nil;
-    lit_bool(bool);
+    lit_str(str),
+    lit_int(i64, int_ty),
+    lit_uint(u64, uint_ty),
+    lit_float(str, float_ty),
+    lit_nil,
+    lit_bool(bool),
 }
 
 // NB: If you change this, you'll probably want to change the corresponding
@@ -303,46 +303,46 @@ enum lit_ {
 
 type ty_method = {ident: ident, decl: fn_decl, tps: [ty_param], span: span};
 
-enum int_ty { ty_i; ty_char; ty_i8; ty_i16; ty_i32; ty_i64; }
+enum int_ty { ty_i, ty_char, ty_i8, ty_i16, ty_i32, ty_i64, }
 
-enum uint_ty { ty_u; ty_u8; ty_u16; ty_u32; ty_u64; }
+enum uint_ty { ty_u, ty_u8, ty_u16, ty_u32, ty_u64, }
 
-enum float_ty { ty_f; ty_f32; ty_f64; }
+enum float_ty { ty_f, ty_f32, ty_f64, }
 
 type ty = spanned<ty_>;
 
 enum ty_ {
-    ty_nil;
-    ty_bot; /* return type of ! functions and type of
+    ty_nil,
+    ty_bot, /* return type of ! functions and type of
              ret/fail/break/cont. there is no syntax
              for this type. */
 
      /* bot represents the value of functions that don't return a value
         locally to their context. in contrast, things like log that do
         return, but don't return a meaningful value, have result type nil. */
-    ty_bool;
-    ty_int(int_ty);
-    ty_uint(uint_ty);
-    ty_float(float_ty);
-    ty_str;
-    ty_box(mt);
-    ty_uniq(mt);
-    ty_vec(mt);
-    ty_ptr(mt);
-    ty_task;
-    ty_port(@ty);
-    ty_chan(@ty);
-    ty_rec([ty_field]);
-    ty_fn(proto, fn_decl);
-    ty_tup([@ty]);
-    ty_path(@path, node_id);
-    ty_type;
-    ty_constr(@ty, [@ty_constr]);
-    ty_mac(mac);
+    ty_bool,
+    ty_int(int_ty),
+    ty_uint(uint_ty),
+    ty_float(float_ty),
+    ty_str,
+    ty_box(mt),
+    ty_uniq(mt),
+    ty_vec(mt),
+    ty_ptr(mt),
+    ty_task,
+    ty_port(@ty),
+    ty_chan(@ty),
+    ty_rec([ty_field]),
+    ty_fn(proto, fn_decl),
+    ty_tup([@ty]),
+    ty_path(@path, node_id),
+    ty_type,
+    ty_constr(@ty, [@ty_constr]),
+    ty_mac(mac),
     // ty_infer means the type should be inferred instead of it having been
     // specified. This should only appear at the "top level" of a type and not
     // nested in one.
-    ty_infer;
+    ty_infer,
 }
 
 
@@ -354,7 +354,7 @@ enum ty_ {
 So, the constr_arg type is parameterized: it's instantiated with uint for
 declarations, and ident for uses.
 */
-enum constr_arg_general_<T> { carg_base; carg_ident(T); carg_lit(@lit); }
+enum constr_arg_general_<T> { carg_base, carg_ident(T), carg_lit(@lit), }
 
 type fn_constr_arg = constr_arg_general_<uint>;
 type sp_constr_arg<T> = spanned<constr_arg_general_<T>>;
@@ -390,15 +390,15 @@ enum ty_ {
      constraints: [@constr]};
 
 enum purity {
-    pure_fn; // declared with "pure fn"
-    unsafe_fn; // declared with "unsafe fn"
-    impure_fn; // declared with "fn"
+    pure_fn, // declared with "pure fn"
+    unsafe_fn, // declared with "unsafe fn"
+    impure_fn, // declared with "fn"
 }
 
 enum ret_style {
-    noreturn; // functions with return type _|_ that always
+    noreturn, // functions with return type _|_ that always
               // raise an error or exit (i.e. never return to the caller)
-    return_val; // everything else
+    return_val, // everything else
 }
 
 type method = {ident: ident, tps: [ty_param], decl: fn_decl, body: blk,
@@ -407,9 +407,9 @@ enum ret_style {
 type _mod = {view_items: [@view_item], items: [@item]};
 
 enum native_abi {
-    native_abi_rust_intrinsic;
-    native_abi_cdecl;
-    native_abi_stdcall;
+    native_abi_rust_intrinsic,
+    native_abi_cdecl,
+    native_abi_stdcall,
 }
 
 type native_mod =
@@ -434,11 +434,11 @@ enum native_abi {
 type import_ident = spanned<import_ident_>;
 
 enum view_item_ {
-    view_item_use(ident, [@meta_item], node_id);
-    view_item_import(ident, @simple_path, node_id);
-    view_item_import_glob(@simple_path, node_id);
-    view_item_import_from(@simple_path, [import_ident], node_id);
-    view_item_export([ident], node_id);
+    view_item_use(ident, [@meta_item], node_id),
+    view_item_import(ident, @simple_path, node_id),
+    view_item_import_glob(@simple_path, node_id),
+    view_item_import_from(@simple_path, [import_ident], node_id),
+    view_item_export([ident], node_id),
 }
 
 // Meta-data associated with an item
@@ -448,7 +448,7 @@ enum view_item_ {
 // Distinguishes between attributes that decorate items and attributes that
 // are contained as statements within items. These two cases need to be
 // distinguished for pretty-printing.
-enum attr_style { attr_outer; attr_inner; }
+enum attr_style { attr_outer, attr_inner, }
 
 type attribute_ = {style: attr_style, value: meta_item};
 
@@ -456,17 +456,17 @@ enum view_item_ {
              id: node_id, node: item_, span: span};
 
 enum item_ {
-    item_const(@ty, @expr);
-    item_fn(fn_decl, [ty_param], blk);
-    item_mod(_mod);
-    item_native_mod(native_mod);
-    item_ty(@ty, [ty_param]);
-    item_tag([variant], [ty_param]);
+    item_const(@ty, @expr),
+    item_fn(fn_decl, [ty_param], blk),
+    item_mod(_mod),
+    item_native_mod(native_mod),
+    item_ty(@ty, [ty_param]),
+    item_tag([variant], [ty_param]),
     item_res(fn_decl /* dtor */, [ty_param], blk,
-             node_id /* dtor id */, node_id /* ctor id */);
-    item_iface([ty_param], [ty_method]);
+             node_id /* dtor id */, node_id /* ctor id */),
+    item_iface([ty_param], [ty_method]),
     item_impl([ty_param], option::t<@ty> /* iface */,
-              @ty /* self */, [@method]);
+              @ty /* self */, [@method]),
 }
 
 type native_item =
@@ -477,8 +477,8 @@ enum item_ {
      span: span};
 
 enum native_item_ {
-    native_item_ty;
-    native_item_fn(fn_decl, [ty_param]);
+    native_item_ty,
+    native_item_fn(fn_decl, [ty_param]),
 }
 
 //
index b1513b24e242a76429d9f2dcbbe31533d5a3e3a3..24b9757a4f4089d418af8a451d4c5dc4dc22c9e8 100644 (file)
@@ -202,10 +202,10 @@ fn ternary_to_if(e: @expr) -> @expr {
 // FIXME this doesn't handle big integer/float literals correctly (nor does
 // the rest of our literal handling)
 enum const_val {
-    const_float(float);
-    const_int(i64);
-    const_uint(u64);
-    const_str(str);
+    const_float(float),
+    const_int(i64),
+    const_uint(u64),
+    const_str(str),
 }
 
 // FIXME: issue #1417
index 7844e9c197e8c303e74e37a422f75e3dd8fbce87..367bd9a02fd25dd0c17aee837f5de9c83de478f4 100644 (file)
@@ -68,8 +68,8 @@ fn lookup_byte_pos(map: codemap, pos: uint) -> loc {
 enum opt_span {
 
     //hack (as opposed to option::t), to make `span` compile
-    os_none;
-    os_some(@span);
+    os_none,
+    os_some(@span),
 }
 type span = {lo: uint, hi: uint, expanded_from: opt_span};
 
index bead9a5d85b25d292cab0ae17e83d50edab0fdca..50ff9932e7ebc1494b376ca2a83bfb1a69d8de2e 100644 (file)
@@ -12,8 +12,8 @@
     fn@(ext_ctxt, span, @ast::expr, option::t<str>) -> macro_def;
 
 enum syntax_extension {
-    normal(syntax_expander);
-    macro_defining(macro_definer);
+    normal(syntax_expander),
+    macro_defining(macro_definer),
 }
 
 // A temporary hard-coded map of methods for expanding syntax extension
index 85d6d451810129ed004d982ec519aabb21637f6d..891a01495ac2d00923e3af1f90cd772fd498b66d 100644 (file)
@@ -25,16 +25,16 @@ fn path_to_ident(pth: @path) -> option::t<ident> {
 type clause = {params: binders, body: @expr};
 
 /* logically, an arb_depth should contain only one kind of matchable */
-enum arb_depth<T> { leaf(T); seq(@[arb_depth<T>], span); }
+enum arb_depth<T> { leaf(T), seq(@[arb_depth<T>], span), }
 
 
 enum matchable {
-    match_expr(@expr);
-    match_path(@path);
-    match_ident(ast::spanned<ident>);
-    match_ty(@ty);
-    match_block(ast::blk);
-    match_exact; /* don't bind anything, just verify the AST traversal */
+    match_expr(@expr),
+    match_path(@path),
+    match_ident(ast::spanned<ident>),
+    match_ty(@ty),
+    match_block(ast::blk),
+    match_exact, /* don't bind anything, just verify the AST traversal */
 }
 
 /* for when given an incompatible bit of AST */
index 78cde98a9c5d76ad9172b85866b44b52a8d9149d..3dc1666b11e31ec24ff3f62c7996f447fc790d8e 100644 (file)
@@ -511,10 +511,10 @@ fn binop(rdr: reader, op: token::binop) -> token::token {
 }
 
 enum cmnt_style {
-    isolated; // No code on either side of each line of the comment
-    trailing; // Code exists to the left of the comment
-    mixed; // Code before /* foo */ and after the comment
-    blank_line; // Just a manual blank line "\n\n", for layout
+    isolated, // No code on either side of each line of the comment
+    trailing, // Code exists to the left of the comment
+    mixed, // Code before /* foo */ and after the comment
+    blank_line, // Just a manual blank line "\n\n", for layout
 }
 
 type cmnt = {style: cmnt_style, lines: [str], pos: uint};
index 373b1f22a4495ba13a948dfeb51486fe32c500a7..61b562480edfbafed7d4c183b0ce3fcd10733354 100644 (file)
 import driver::diagnostic;
 
 enum restriction {
-    UNRESTRICTED;
-    RESTRICT_STMT_EXPR;
-    RESTRICT_NO_CALL_EXPRS;
-    RESTRICT_NO_BAR_OP;
+    UNRESTRICTED,
+    RESTRICT_STMT_EXPR,
+    RESTRICT_NO_CALL_EXPRS,
+    RESTRICT_NO_BAR_OP,
 }
 
-enum file_type { CRATE_FILE; SOURCE_FILE; }
+enum file_type { CRATE_FILE, SOURCE_FILE, }
 
 type parse_sess = @{
     cm: codemap::codemap,
@@ -722,7 +722,7 @@ fn mk_lit_u32(p: parser, i: u32) -> @ast::expr {
 // part of the AST, we wrap such expressions in the pexpr enum.  They
 // can then be converted to true expressions by a call to `to_expr()`.
 enum pexpr {
-    pexpr(@ast::expr);
+    pexpr(@ast::expr),
 }
 
 fn mk_pexpr(p: parser, lo: uint, hi: uint, node: ast::expr_) -> pexpr {
index e1851d831b10d2623b495d5a43d8cafa1734f00a..0965697f8c8b3876b191443d2b0723a7e2993033 100644 (file)
@@ -6,70 +6,70 @@
 type str_num = uint;
 
 enum binop {
-    PLUS;
-    MINUS;
-    STAR;
-    SLASH;
-    PERCENT;
-    CARET;
-    AND;
-    OR;
-    LSL;
-    LSR;
-    ASR;
+    PLUS,
+    MINUS,
+    STAR,
+    SLASH,
+    PERCENT,
+    CARET,
+    AND,
+    OR,
+    LSL,
+    LSR,
+    ASR,
 }
 
 enum token {
     /* Expression-operator symbols. */
-    EQ;
-    LT;
-    LE;
-    EQEQ;
-    NE;
-    GE;
-    GT;
-    ANDAND;
-    OROR;
-    NOT;
-    TILDE;
-    BINOP(binop);
-    BINOPEQ(binop);
+    EQ,
+    LT,
+    LE,
+    EQEQ,
+    NE,
+    GE,
+    GT,
+    ANDAND,
+    OROR,
+    NOT,
+    TILDE,
+    BINOP(binop),
+    BINOPEQ(binop),
 
     /* Structural symbols */
-    AT;
-    DOT;
-    ELLIPSIS;
-    COMMA;
-    SEMI;
-    COLON;
-    MOD_SEP;
-    QUES;
-    RARROW;
-    LARROW;
-    DARROW;
-    LPAREN;
-    RPAREN;
-    LBRACKET;
-    RBRACKET;
-    LBRACE;
-    RBRACE;
-    POUND;
-    POUND_LBRACE;
-    POUND_LT;
+    AT,
+    DOT,
+    ELLIPSIS,
+    COMMA,
+    SEMI,
+    COLON,
+    MOD_SEP,
+    QUES,
+    RARROW,
+    LARROW,
+    DARROW,
+    LPAREN,
+    RPAREN,
+    LBRACKET,
+    RBRACKET,
+    LBRACE,
+    RBRACE,
+    POUND,
+    POUND_LBRACE,
+    POUND_LT,
 
     /* Literals */
-    LIT_INT(i64, ast::int_ty);
-    LIT_UINT(u64, ast::uint_ty);
-    LIT_FLOAT(str_num, ast::float_ty);
-    LIT_STR(str_num);
-    LIT_BOOL(bool);
+    LIT_INT(i64, ast::int_ty),
+    LIT_UINT(u64, ast::uint_ty),
+    LIT_FLOAT(str_num, ast::float_ty),
+    LIT_STR(str_num),
+    LIT_BOOL(bool),
 
     /* Name components */
-    IDENT(str_num, bool);
-    IDX(int);
-    UNDERSCORE;
-    BRACEQUOTE(str_num);
-    EOF;
+    IDENT(str_num, bool),
+    IDX(int),
+    UNDERSCORE,
+    BRACEQUOTE(str_num),
+    EOF,
 }
 
 fn binop_to_str(o: binop) -> str {
index 4950af7b624ddaf6ef2acc492b9a42b6cb8363d0..6a714158d3b4ab60d8542cc96898b5ff5b8682e7 100644 (file)
  * line (which it can't) and so naturally place the content on its own line to
  * avoid combining it with other lines and making matters even worse.
  */
-enum breaks { consistent; inconsistent; }
+enum breaks { consistent, inconsistent, }
 
 type break_t = {offset: int, blank_space: int};
 
 type begin_t = {offset: int, breaks: breaks};
 
-enum token { STRING(str, int); BREAK(break_t); BEGIN(begin_t); END; EOF; }
+enum token { STRING(str, int), BREAK(break_t), BEGIN(begin_t), END, EOF, }
 
 fn tok_str(t: token) -> str {
     alt t {
@@ -91,7 +91,7 @@ fn buf_str(toks: [mutable token], szs: [mutable int], left: uint, right: uint,
     ret s;
 }
 
-enum print_stack_break { fits; broken(breaks); }
+enum print_stack_break { fits, broken(breaks), }
 
 type print_stack_elt = {offset: int, pbreak: print_stack_break};
 
index 3717dc8378026578fa9affff523bdbc8d119b943..2b62157593b3276ac10a16502559c77788046bdb 100644 (file)
 // The ps is stored here to prevent recursive type.
 // FIXME use a nominal enum instead
 enum ann_node {
-    node_block(ps, ast::blk);
-    node_item(ps, @ast::item);
-    node_expr(ps, @ast::expr);
-    node_pat(ps, @ast::pat);
+    node_block(ps, ast::blk),
+    node_item(ps, @ast::item),
+    node_expr(ps, @ast::expr),
+    node_pat(ps, @ast::pat),
 }
 type pp_ann = {pre: fn@(ann_node), post: fn@(ann_node)};
 
@@ -565,7 +565,7 @@ fn print_block_with_attrs(s: ps, blk: ast::blk, attrs: [ast::attribute]) {
     print_possibly_embedded_block_(s, blk, block_normal, indent_unit, attrs);
 }
 
-enum embed_type { block_macro; block_block_fn; block_normal; }
+enum embed_type { block_macro, block_block_fn, block_normal, }
 
 fn print_possibly_embedded_block(s: ps, blk: ast::blk, embedded: embed_type,
                                  indented: uint) {
index 8f0f1f6f5587e9cacc16712ebd29932b539f8c11..ddabc5e1c48e64e84386676fc6515dc01eecbbe7 100644 (file)
 
 // Our typesystem doesn't do circular types, so the visitor record can not
 // hold functions that take visitors. A vt enum is used to break the cycle.
-enum vt<E> { mk_vt(visitor<E>); }
+enum vt<E> { mk_vt(visitor<E>), }
 
 enum fn_kind {
-    fk_item_fn(ident, [ty_param]); //< an item declared with fn()
-    fk_method(ident, [ty_param]);
-    fk_res(ident, [ty_param]);
-    fk_anon(proto);  //< an anonymous function like fn@(...)
-    fk_fn_block;     //< a block {||...}
+    fk_item_fn(ident, [ty_param]), //< an item declared with fn()
+    fk_method(ident, [ty_param]),
+    fk_res(ident, [ty_param]),
+    fk_anon(proto),  //< an anonymous function like fn@(...)
+    fk_fn_block,     //< a block {||...}
 }
 
 fn name_of_fn(fk: fn_kind) -> ident {