Skip to content

Commit

Permalink
Remove support for the '.' after a nullary tag in a pattern
Browse files Browse the repository at this point in the history
(Commit also includes lots of changes to remove '.'s that a git
merge messed up, or else it was monkeys.)
  • Loading branch information
catamorphism committed Jan 19, 2012
1 parent 9df0306 commit 5b028f5
Show file tree
Hide file tree
Showing 42 changed files with 125 additions and 130 deletions.
6 changes: 3 additions & 3 deletions src/comp/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,9 @@ fn link_binary(sess: session,
ret str::connect(parts, ".");
}
ret alt config.os {
session::os_macos. { rmext(rmlib(filename)) }
session::os_linux. { rmext(rmlib(filename)) }
session::os_freebsd. { rmext(rmlib(filename)) }
session::os_macos { rmext(rmlib(filename)) }
session::os_linux { rmext(rmlib(filename)) }
session::os_freebsd { rmext(rmlib(filename)) }
_ { rmext(filename) }
};
}
Expand Down
6 changes: 3 additions & 3 deletions src/comp/back/rpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ fn get_rpath_relative_to_output(os: session::os,
&&lib: fs::path) -> str {
// Mac doesn't appear to support $ORIGIN
let prefix = alt os {
session::os_linux. { "$ORIGIN" + fs::path_sep() }
session::os_freebsd. { "$ORIGIN" + fs::path_sep() }
session::os_macos. { "@executable_path" + fs::path_sep() }
session::os_linux { "$ORIGIN" + fs::path_sep() }
session::os_freebsd { "$ORIGIN" + fs::path_sep() }
session::os_macos { "@executable_path" + fs::path_sep() }
};

prefix + get_relative_to(
Expand Down
34 changes: 17 additions & 17 deletions src/comp/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ fn default_configuration(sess: session, argv0: str, input: str) ->
ast::crate_cfg {
let libc =
alt sess.targ_cfg.os {
session::os_win32. { "msvcrt.dll" }
session::os_macos. { "libc.dylib" }
session::os_linux. { "libc.so.6" }
session::os_freebsd. { "libc.so.7" }
session::os_win32 { "msvcrt.dll" }
session::os_macos { "libc.dylib" }
session::os_linux { "libc.so.6" }
session::os_freebsd { "libc.so.7" }
_ { "libc.so" }
};

let mk = attr::mk_name_value_item_str;

let arch = alt sess.targ_cfg.arch {
session::arch_x86. { "x86" }
session::arch_x86_64. { "x86_64" }
session::arch_arm. { "arm" }
session::arch_x86 { "x86" }
session::arch_x86_64 { "x86_64" }
session::arch_arm { "arm" }
};

ret [ // Target bindings.
Expand Down Expand Up @@ -340,14 +340,14 @@ fn build_target_config(sopts: @session::options,
"Unknown architecture! " + sopts.target_triple) }
};
let (int_type, uint_type, float_type) = alt arch {
session::arch_x86. {(ast::ty_i32, ast::ty_u32, ast::ty_f64)}
session::arch_x86_64. {(ast::ty_i64, ast::ty_u64, ast::ty_f64)}
session::arch_arm. {(ast::ty_i32, ast::ty_u32, ast::ty_f64)}
session::arch_x86 {(ast::ty_i32, ast::ty_u32, ast::ty_f64)}
session::arch_x86_64 {(ast::ty_i64, ast::ty_u64, ast::ty_f64)}
session::arch_arm {(ast::ty_i32, ast::ty_u32, ast::ty_f64)}
};
let target_strs = alt arch {
session::arch_x86. {x86::get_target_strs(os)}
session::arch_x86_64. {x86_64::get_target_strs(os)}
session::arch_arm. {x86::get_target_strs(os)}
session::arch_x86 {x86::get_target_strs(os)}
session::arch_x86_64 {x86_64::get_target_strs(os)}
session::arch_arm {x86::get_target_strs(os)}
};
let target_cfg: @session::config =
@{os: os, arch: arch, target_strs: target_strs, int_type: int_type,
Expand Down Expand Up @@ -406,7 +406,7 @@ fn build_session_options(match: getopts::match,
let no_asm_comments = getopts::opt_present(match, "no-asm-comments");
alt output_type {
// unless we're emitting huamn-readable assembly, omit comments.
link::output_type_llvm_assembly. | link::output_type_assembly. {}
link::output_type_llvm_assembly | link::output_type_assembly {}
_ { no_asm_comments = true; }
}
let opt_level: uint =
Expand Down Expand Up @@ -540,10 +540,10 @@ fn build_output_filenames(ifile: str,
alt sopts.output_type {
link::output_type_none { "none" }
link::output_type_bitcode { "bc" }
link::output_type_assembly. { "s" }
link::output_type_llvm_assembly. { "ll" }
link::output_type_assembly { "s" }
link::output_type_llvm_assembly { "ll" }
// Object and exe output both use the '.o' extension here
link::output_type_object. | link::output_type_exe. {
link::output_type_object | link::output_type_exe {
"o"
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/comp/driver/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn run_compiler(args: [str], demitter: diagnostic::emitter) {
bind parse_pretty(sess, _));
alt pretty {
some::<pp_mode>(ppm) { pretty_print_input(sess, cfg, ifile, ppm); ret; }
none::<pp_mode>. {/* continue */ }
none::<pp_mode> {/* continue */ }
}
let ls = opt_present(match, "ls");
if ls {
Expand Down
8 changes: 4 additions & 4 deletions src/comp/metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ fn default_native_lib_naming(sess: session::session, static: bool) ->
{prefix: str, suffix: str} {
if static { ret {prefix: "lib", suffix: ".rlib"}; }
alt sess.targ_cfg.os {
session::os_win32. { ret {prefix: "", suffix: ".dll"}; }
session::os_macos. { ret {prefix: "lib", suffix: ".dylib"}; }
session::os_linux. { ret {prefix: "lib", suffix: ".so"}; }
session::os_freebsd. { ret {prefix: "lib", suffix: ".so"}; }
session::os_win32 { ret {prefix: "", suffix: ".dll"}; }
session::os_macos { ret {prefix: "lib", suffix: ".dylib"}; }
session::os_linux { ret {prefix: "lib", suffix: ".so"}; }
session::os_freebsd { ret {prefix: "lib", suffix: ".so"}; }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/comp/middle/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ fn create_ty(cx: @crate_ctxt, t: ty::t, ty: @ast::ty)
ret create_pointer_type(cx, t, ty.span, md);
}

ast::ty_infer. {
ast::ty_infer {
let inferred = t_to_ty(cx, t, ty.span);
ret create_ty(cx, t, inferred);
}
Expand Down
3 changes: 1 addition & 2 deletions src/comp/middle/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ fn type_is_gc_relevant(cx: ty::ctxt, ty: ty::t) -> bool {
alt ty::struct(cx, ty) {
ty::ty_nil | ty::ty_bot | ty::ty_bool | ty::ty_int(_) |
ty::ty_float(_) | ty::ty_uint(_) | ty::ty_str |
ty::ty_type | ty::ty_native(_) | ty::ty_ptr(_) | ty::ty_type. |
ty::ty_native(_) {
ty::ty_type | ty::ty_ptr(_) | ty::ty_native(_) {
ret false;
}

Expand Down
6 changes: 3 additions & 3 deletions src/comp/middle/mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ fn check_lval(cx: @ctx, dest: @expr, msg: msg) {
} else if !root.ds[0].mut {
let name =
alt root.ds[0].kind {
mut::unbox. { "immutable box" }
mut::field. { "immutable field" }
mut::index. { "immutable vec content" }
mut::unbox { "immutable box" }
mut::field { "immutable field" }
mut::index { "immutable vec content" }
};
mk_err(cx, dest.span, msg, name);
}
Expand Down
18 changes: 9 additions & 9 deletions src/comp/middle/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,25 +246,25 @@ fn tag_kind(ccx: @crate_ctxt, did: ast::def_id) -> tag_kind {
// Returns the code corresponding to the pointer size on this architecture.
fn s_int(tcx: ty_ctxt) -> u8 {
ret alt tcx.sess.targ_cfg.arch {
session::arch_x86. { shape_i32 }
session::arch_x86_64. { shape_i64 }
session::arch_arm. { shape_i32 }
session::arch_x86 { shape_i32 }
session::arch_x86_64 { shape_i64 }
session::arch_arm { shape_i32 }
};
}

fn s_uint(tcx: ty_ctxt) -> u8 {
ret alt tcx.sess.targ_cfg.arch {
session::arch_x86. { shape_u32 }
session::arch_x86_64. { shape_u64 }
session::arch_arm. { shape_u32 }
session::arch_x86 { shape_u32 }
session::arch_x86_64 { shape_u64 }
session::arch_arm { shape_u32 }
};
}

fn s_float(tcx: ty_ctxt) -> u8 {
ret alt tcx.sess.targ_cfg.arch {
session::arch_x86. { shape_f64 }
session::arch_x86_64. { shape_f64 }
session::arch_arm. { shape_f64 }
session::arch_x86 { shape_f64 }
session::arch_x86_64 { shape_f64 }
session::arch_arm { shape_f64 }
};
}

Expand Down
30 changes: 15 additions & 15 deletions src/comp/middle/trans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1904,8 +1904,8 @@ fn call_memmove(cx: @block_ctxt, dst: ValueRef, src: ValueRef,

let ccx = bcx_ccx(cx);
let key = alt ccx.sess.targ_cfg.arch {
session::arch_x86. | session::arch_arm. { "llvm.memmove.p0i8.p0i8.i32" }
session::arch_x86_64. { "llvm.memmove.p0i8.p0i8.i64" }
session::arch_x86 | session::arch_arm { "llvm.memmove.p0i8.p0i8.i32" }
session::arch_x86_64 { "llvm.memmove.p0i8.p0i8.i64" }
};
let i = ccx.intrinsics;
assert (i.contains_key(key));
Expand Down Expand Up @@ -2915,10 +2915,10 @@ fn trans_cast(cx: @block_ctxt, e: @ast::expr, id: ast::node_id,

let newval =
alt {in: k_in, out: k_out} {
{in: integral, out: integral.} {
{in: integral, out: integral} {
int_cast(e_res.bcx, ll_t_out, ll_t_in, e_res.val, s_in)
}
{in: float, out: float.} {
{in: float, out: float} {
float_cast(e_res.bcx, ll_t_out, ll_t_in, e_res.val)
}
{in: integral, out: float} {
Expand All @@ -2937,10 +2937,10 @@ fn trans_cast(cx: @block_ctxt, e: @ast::expr, id: ast::node_id,
{in: pointer, out: integral} {
PtrToInt(e_res.bcx, e_res.val, ll_t_out)
}
{in: pointer, out: pointer.} {
{in: pointer, out: pointer} {
PointerCast(e_res.bcx, e_res.val, ll_t_out)
}
{in: tag_, out: integral} | {in: tag_., out: float} {
{in: tag_, out: integral} | {in: tag_, out: float} {
let cx = e_res.bcx;
let lltagty = T_opaque_tag_ptr(ccx);
let av_tag = PointerCast(cx, e_res.val, lltagty);
Expand Down Expand Up @@ -3559,11 +3559,11 @@ fn trans_expr(bcx: @block_ctxt, e: @ast::expr, dest: dest) -> @block_ctxt {
assert dest == ignore;
ret trans_check_expr(bcx, a, "Assertion");
}
ast::expr_check(ast::checked_expr., a) {
ast::expr_check(ast::checked_expr, a) {
assert dest == ignore;
ret trans_check_expr(bcx, a, "Predicate");
}
ast::expr_check(ast::claimed_expr., a) {
ast::expr_check(ast::claimed_expr, a) {
assert dest == ignore;
/* Claims are turned on and off by a global variable
that the RTS sets. This case generates code to
Expand Down Expand Up @@ -3945,8 +3945,8 @@ fn zero_alloca(cx: @block_ctxt, llptr: ValueRef, t: ty::t)
Store(bcx, C_null(llty), llptr);
} else {
let key = alt ccx.sess.targ_cfg.arch {
session::arch_x86. | session::arch_arm. { "llvm.memset.p0i8.i32" }
session::arch_x86_64. { "llvm.memset.p0i8.i64" }
session::arch_x86 | session::arch_arm { "llvm.memset.p0i8.i32" }
session::arch_x86_64 { "llvm.memset.p0i8.i64" }
};
let i = ccx.intrinsics;
let memset = i.get(key);
Expand Down Expand Up @@ -4841,9 +4841,9 @@ fn trans_native_mod(lcx: @local_ctxt, native_mod: ast::native_mod,
let ccx = lcx_ccx(lcx);
let cc = lib::llvm::LLVMCCallConv;
alt abi {
ast::native_abi_rust_intrinsic. { ret; }
ast::native_abi_cdecl. { cc = lib::llvm::LLVMCCallConv; }
ast::native_abi_stdcall. { cc = lib::llvm::LLVMX86StdcallCallConv; }
ast::native_abi_rust_intrinsic { ret; }
ast::native_abi_cdecl { cc = lib::llvm::LLVMCCallConv; }
ast::native_abi_stdcall { cc = lib::llvm::LLVMX86StdcallCallConv; }
}

for native_item in native_mod.items {
Expand Down Expand Up @@ -5143,7 +5143,7 @@ fn collect_native_item(ccx: @crate_ctxt,
}
};
alt fn_abi {
ast::native_abi_rust_intrinsic. {
ast::native_abi_rust_intrinsic {
// For intrinsics: link the function directly to the intrinsic
// function itself.
let fn_type = type_of_fn_from_ty(
Expand All @@ -5157,7 +5157,7 @@ fn collect_native_item(ccx: @crate_ctxt,
ccx.item_symbols.insert(id, ri_name);
}

ast::native_abi_cdecl. | ast::native_abi_stdcall. {
ast::native_abi_cdecl | ast::native_abi_stdcall {
// For true external functions: create a rust wrapper
// and link to that. The rust wrapper will handle
// switching to the C stack.
Expand Down
10 changes: 5 additions & 5 deletions src/comp/middle/trans_closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,18 +419,18 @@ fn build_closure(bcx0: @block_ctxt,
let nid = ast_util::def_id_of_def(cap_var.def).node;
let ty = ty::node_id_to_monotype(tcx, nid);
alt cap_var.mode {
capture::cap_ref. {
capture::cap_ref {
assert ck == ty::ck_block;
ty = ty::mk_mut_ptr(tcx, ty);
env_vals += [env_ref(lv.val, ty, lv.kind)];
}
capture::cap_copy. {
capture::cap_copy {
env_vals += [env_copy(lv.val, ty, lv.kind)];
}
capture::cap_move. {
capture::cap_move {
env_vals += [env_move(lv.val, ty, lv.kind)];
}
capture::cap_drop. {
capture::cap_drop {
bcx = drop_ty(bcx, lv.val, ty);
}
}
Expand Down Expand Up @@ -481,7 +481,7 @@ fn load_environment(enclosing_cx: @block_ctxt,
let i = 0u;
vec::iter(cap_vars) { |cap_var|
alt cap_var.mode {
capture::cap_drop. { /* ignore */ }
capture::cap_drop { /* ignore */ }
_ {
check type_is_tup_like(bcx, cbox_ty);
let upvarptr = GEP_tup_like(
Expand Down
12 changes: 6 additions & 6 deletions src/comp/middle/trans_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ fn T_bool() -> TypeRef { ret T_i1(); }

fn T_int(targ_cfg: @session::config) -> TypeRef {
ret alt targ_cfg.arch {
session::arch_x86. { T_i32() }
session::arch_x86_64. { T_i64() }
session::arch_arm. { T_i32() }
session::arch_x86 { T_i32() }
session::arch_x86_64 { T_i64() }
session::arch_arm { T_i32() }
};
}

Expand Down Expand Up @@ -520,9 +520,9 @@ fn T_float_ty(cx: @crate_ctxt, t: ast::float_ty) -> TypeRef {

fn T_float(targ_cfg: @session::config) -> TypeRef {
ret alt targ_cfg.arch {
session::arch_x86. { T_f64() }
session::arch_x86_64. { T_f64() }
session::arch_arm. { T_f64() }
session::arch_x86 { T_f64() }
session::arch_x86_64 { T_f64() }
session::arch_arm { T_f64() }
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/comp/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2534,7 +2534,7 @@ fn type_err_to_str(err: ty::type_err) -> str {
fn to_str(s: ast::ret_style) -> str {
alt s {
ast::noreturn { "non-returning" }
ast::return_val. { "return-by-value" }
ast::return_val { "return-by-value" }
}
}
ret to_str(actual) + " function found where " + to_str(expect) +
Expand Down
12 changes: 6 additions & 6 deletions src/comp/middle/typeck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
}
typ = ty::mk_constr(tcx, ast_ty_to_ty(tcx, mode, t), out_cs);
}
ast::ty_infer. {
ast::ty_infer {
alt mode {
m_check_tyvar(fcx) { ret next_ty_var(fcx); }
_ { tcx.sess.span_bug(ast_ty.span,
Expand Down Expand Up @@ -539,7 +539,7 @@ fn ast_ty_to_ty_crate(ccx: @crate_ctxt, &&ast_ty: @ast::ty) -> ty::t {
fn ast_ty_to_ty_crate_infer(ccx: @crate_ctxt, &&ast_ty: @ast::ty) ->
option::t<ty::t> {
alt ast_ty.node {
ast::ty_infer. { none }
ast::ty_infer { none }
_ { some(ast_ty_to_ty_crate(ccx, ast_ty)) }
}
}
Expand Down Expand Up @@ -2406,9 +2406,9 @@ fn check_block_no_value(fcx: @fn_ctxt, blk: ast::blk) -> bool {

fn check_block(fcx0: @fn_ctxt, blk: ast::blk) -> bool {
let fcx = alt blk.node.rules {
ast::unchecked_blk. { @{purity: ast::impure_fn with *fcx0} }
ast::unsafe_blk. { @{purity: ast::unsafe_fn with *fcx0} }
ast::default_blk. { fcx0 }
ast::unchecked_blk { @{purity: ast::impure_fn with *fcx0} }
ast::unsafe_blk { @{purity: ast::unsafe_fn with *fcx0} }
ast::default_blk { fcx0 }
};
let bot = false;
let warned = false;
Expand Down Expand Up @@ -2745,7 +2745,7 @@ fn check_main_fn_ty(tcx: ty::ctxt, main_id: ast::node_id) {
let main_t = ty::node_id_to_monotype(tcx, main_id);
alt ty::struct(tcx, main_t) {
ty::ty_fn({proto: ast::proto_bare, inputs, output,
ret_style: ast::return_val., constraints}) {
ret_style: ast::return_val, constraints}) {
let ok = vec::len(constraints) == 0u;
ok &= ty::type_is_nil(tcx, output);
let num_args = vec::len(inputs);
Expand Down
2 changes: 1 addition & 1 deletion src/comp/syntax/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ fn noop_fold_local(l: local_, fld: ast_fold) -> local_ {
pat: fld.fold_pat(l.pat),
init:
alt l.init {
option::none::<initializer>. { l.init }
option::none::<initializer> { l.init }
option::some::<initializer>(init) {
option::some::<initializer>({op: init.op,
expr: fld.fold_expr(init.expr)})
Expand Down
Loading

0 comments on commit 5b028f5

Please sign in to comment.