Name types after their modules instead of 't'

This commit is contained in:
Brian Anderson
2012-03-13 14:39:28 -07:00
parent a38ccf1254
commit b968c8e6cd
29 changed files with 190 additions and 189 deletions

View File

@@ -231,7 +231,7 @@ fn require_unique_names(sess: session, metas: [@ast::meta_item]) {
}
}
fn native_abi(attrs: [ast::attribute]) -> either::t<str, ast::native_abi> {
fn native_abi(attrs: [ast::attribute]) -> either<str, ast::native_abi> {
ret alt attr::get_meta_item_value_str_by_name(attrs, "abi") {
option::none {
either::right(ast::native_abi_cdecl)

View File

@@ -261,7 +261,7 @@ fn serialize_20<S: std::serialization::serializer>(s: S, v: uint) {
/*core::option::t<syntax::codemap::span>*/
fn serialize_26<S: std::serialization::serializer>(s: S,
v:
core::option::t<syntax::codemap::span>) {
core::option<syntax::codemap::span>) {
s.emit_enum("core::option::t",
/*syntax::codemap::span*/
@@ -291,7 +291,7 @@ fn serialize_25<S: std::serialization::serializer>(s: S,
v:
{name: str,
span:
core::option::t<syntax::codemap::span>,}) {
core::option<syntax::codemap::span>,}) {
s.emit_rec(/*str*//*core::option::t<syntax::codemap::span>*/
{||
{
@@ -311,7 +311,7 @@ fn serialize_24<S: std::serialization::serializer>(s: S,
callie:
{name: str,
span:
core::option::t<syntax::codemap::span>,},}) {
core::option<syntax::codemap::span>,},}) {
s.emit_rec(/*syntax::codemap::span*/
/*{name: str,span: core::option::t<syntax::codemap::span>}*/
{||
@@ -1269,7 +1269,7 @@ fn serialize_76<S: std::serialization::serializer>(s: S,
/*core::option::t<@syntax::ast::expr>*/
fn serialize_79<S: std::serialization::serializer>(s: S,
v:
core::option::t<@syntax::ast::expr>) {
core::option<@syntax::ast::expr>) {
s.emit_enum("core::option::t",
/*@syntax::ast::expr*/
@@ -1297,7 +1297,7 @@ fn serialize_79<S: std::serialization::serializer>(s: S,
/*[core::option::t<@syntax::ast::expr>]*/
fn serialize_80<S: std::serialization::serializer>(s: S,
v:
[core::option::t<@syntax::ast::expr>]) {
[core::option<@syntax::ast::expr>]) {
s.emit_vec(vec::len(v), /*core::option::t<@syntax::ast::expr>*/
{||
vec::iteri(v,
@@ -1712,7 +1712,7 @@ fn serialize_85<S: std::serialization::serializer>(s: S,
/*core::option::t<@syntax::ast::pat>*/
fn serialize_112<S: std::serialization::serializer>(s: S,
v:
core::option::t<@syntax::ast::pat>) {
core::option<@syntax::ast::pat>) {
s.emit_enum("core::option::t",
/*@syntax::ast::pat*/
@@ -1973,7 +1973,7 @@ fn serialize_117<S: std::serialization::serializer>(s: S,
/*core::option::t<syntax::ast::initializer>*/
fn serialize_116<S: std::serialization::serializer>(s: S,
v:
core::option::t<syntax::ast::initializer>) {
core::option<syntax::ast::initializer>) {
s.emit_enum("core::option::t",
/*syntax::ast::initializer*/
@@ -3950,7 +3950,7 @@ fn serialize_159<S: std::serialization::serializer>(s: S,
/*core::option::t<@syntax::ast::ty>*/
fn serialize_161<S: std::serialization::serializer>(s: S,
v:
core::option::t<@syntax::ast::ty>) {
core::option<@syntax::ast::ty>) {
s.emit_enum("core::option::t",
/*@syntax::ast::ty*/
@@ -4471,7 +4471,7 @@ fn deserialize_20<S: std::serialization::deserializer>(s: S) -> uint {
}
/*core::option::t<syntax::codemap::span>*/
fn deserialize_26<S: std::serialization::deserializer>(s: S) ->
core::option::t<syntax::codemap::span> {
core::option<syntax::codemap::span> {
s.read_enum("core::option::t",
@@ -4492,7 +4492,7 @@ fn deserialize_26<S: std::serialization::deserializer>(s: S) ->
}
/*{name: str,span: core::option::t<syntax::codemap::span>}*/
fn deserialize_25<S: std::serialization::deserializer>(s: S) ->
{name: str, span: core::option::t<syntax::codemap::span>,} {
{name: str, span: core::option<syntax::codemap::span>,} {
s.read_rec(
@@ -4513,7 +4513,7 @@ fn deserialize_25<S: std::serialization::deserializer>(s: S) ->
/*{call_site: syntax::codemap::span,callie: {name: str,span: core::option::t<syntax::codemap::span>}}*/
fn deserialize_24<S: std::serialization::deserializer>(s: S) ->
{call_site: syntax::codemap::span,
callie: {name: str, span: core::option::t<syntax::codemap::span>,},} {
callie: {name: str, span: core::option<syntax::codemap::span>,},} {
s.read_rec(
@@ -5501,7 +5501,7 @@ fn deserialize_76<S: std::serialization::deserializer>(s: S) ->
}
/*core::option::t<@syntax::ast::expr>*/
fn deserialize_79<S: std::serialization::deserializer>(s: S) ->
core::option::t<@syntax::ast::expr> {
core::option<@syntax::ast::expr> {
s.read_enum("core::option::t",
@@ -5522,7 +5522,7 @@ fn deserialize_79<S: std::serialization::deserializer>(s: S) ->
}
/*[core::option::t<@syntax::ast::expr>]*/
fn deserialize_80<S: std::serialization::deserializer>(s: S) ->
[core::option::t<@syntax::ast::expr>] {
[core::option<@syntax::ast::expr>] {
s.read_vec(
/*core::option::t<@syntax::ast::expr>*/
@@ -5886,7 +5886,7 @@ fn deserialize_85<S: std::serialization::deserializer>(s: S) ->
}
/*core::option::t<@syntax::ast::pat>*/
fn deserialize_112<S: std::serialization::deserializer>(s: S) ->
core::option::t<@syntax::ast::pat> {
core::option<@syntax::ast::pat> {
s.read_enum("core::option::t",
@@ -6114,7 +6114,7 @@ fn deserialize_117<S: std::serialization::deserializer>(s: S) ->
}
/*core::option::t<syntax::ast::initializer>*/
fn deserialize_116<S: std::serialization::deserializer>(s: S) ->
core::option::t<syntax::ast::initializer> {
core::option<syntax::ast::initializer> {
s.read_enum("core::option::t",
@@ -7890,7 +7890,7 @@ fn deserialize_159<S: std::serialization::deserializer>(s: S) ->
}
/*core::option::t<@syntax::ast::ty>*/
fn deserialize_161<S: std::serialization::deserializer>(s: S) ->
core::option::t<@syntax::ast::ty> {
core::option<@syntax::ast::ty> {
s.read_enum("core::option::t",

View File

@@ -183,7 +183,7 @@ fn allocate_cbox(bcx: block,
fn store_uniq_tydesc(bcx: block,
cdata_ty: ty::t,
box: ValueRef,
&ti: option::t<@tydesc_info>) -> block {
&ti: option<@tydesc_info>) -> block {
let ccx = bcx.ccx();
let bound_tydesc = GEPi(bcx, box, [0, abi::box_field_tydesc]);
let {bcx, val: td} = base::get_tydesc(bcx, cdata_ty, true, ti);

View File

@@ -1509,7 +1509,7 @@ fn arg_mode(cx: ctxt, a: arg) -> ast::rmode { resolved_mode(cx, a.mode) }
// Unifies `m1` and `m2`. Returns unified value or failure code.
fn unify_mode(cx: ctxt, m1: ast::mode, m2: ast::mode)
-> result::t<ast::mode, type_err> {
-> result<ast::mode, type_err> {
alt (canon_mode(cx, m1), canon_mode(cx, m2)) {
(m1, m2) if (m1 == m2) {
result::ok(m1)
@@ -1758,7 +1758,7 @@ mod unify {
};
}
fn unify_args(cx: @uctxt, e_args: [arg], a_args: [arg],
variance: variance) -> either::t<result, [arg]> {
variance: variance) -> either<result, [arg]> {
if !vec::same_length(e_args, a_args) {
ret either::left(ures_err(terr_arg_count));
}

View File

@@ -1701,7 +1701,7 @@ fn impl_self_ty(tcx: ty::ctxt, did: ast::def_id) -> {n_tps: uint, ty: ty::t} {
fn lookup_method(fcx: @fn_ctxt, expr: @ast::expr, node_id: ast::node_id,
name: ast::ident, ty: ty::t, tps: [ty::t])
-> option::t<method_origin> {
-> option<method_origin> {
alt lookup_method_inner(fcx, expr, name, ty) {
some({method_ty: fty, n_tps: method_n_tps, substs, origin, self_sub}) {
let tcx = fcx.ccx.tcx;
@@ -1743,9 +1743,9 @@ fn lookup_method(fcx: @fn_ctxt, expr: @ast::expr, node_id: ast::node_id,
fn lookup_method_inner(fcx: @fn_ctxt, expr: @ast::expr,
name: ast::ident, ty: ty::t)
-> option::t<{method_ty: ty::t, n_tps: uint, substs: [ty::t],
-> option<{method_ty: ty::t, n_tps: uint, substs: [ty::t],
origin: method_origin,
self_sub: option::t<self_subst>}> {
self_sub: option<self_subst>}> {
let tcx = fcx.ccx.tcx;
// First, see whether this is an interface-bounded parameter
alt ty::get(ty).struct {
@@ -2120,8 +2120,8 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
}
}
fn lookup_op_method(fcx: @fn_ctxt, op_ex: @ast::expr, self_t: ty::t,
opname: str, args: [option::t<@ast::expr>])
-> option::t<ty::t> {
opname: str, args: [option<@ast::expr>])
-> option<ty::t> {
let callee_id = ast_util::op_expr_callee_id(op_ex);
alt lookup_method(fcx, op_ex, callee_id, opname, self_t, []) {
some(origin) {

View File

@@ -291,10 +291,10 @@ enum blk_sort {
type mac = spanned<mac_>;
type mac_arg = option::t<@expr>;
type mac_arg = option<@expr>;
type mac_body_ = {span: span};
type mac_body = option::t<mac_body_>;
type mac_body = option<mac_body_>;
enum mac_ {
mac_invoc(@path, mac_arg, mac_body),

View File

@@ -643,7 +643,7 @@ fn parse_seq<T: copy>(bra: token::token, ket: token::token,
ret spanned(lo, hi, result);
}
fn have_dollar(p: parser) -> option::t<ast::mac_> {
fn have_dollar(p: parser) -> option<ast::mac_> {
alt p.token {
token::DOLLAR_NUM(num) {
p.bump();
@@ -2384,7 +2384,7 @@ else { ret none; }
// A type to distingush between the parsing of item attributes or syntax
// extensions, which both begin with token.POUND
type attr_or_ext = option<either::t<[ast::attribute], @ast::expr>>;
type attr_or_ext = option<either<[ast::attribute], @ast::expr>>;
fn parse_outer_attrs_or_ext(
p: parser,

View File

@@ -109,12 +109,12 @@ fn get_sysroot(maybe_sysroot: option<path>) -> path {
}
}
fn get_cargo_sysroot() -> result::t<path, str> {
fn get_cargo_sysroot() -> result<path, str> {
let path = [get_default_sysroot(), libdir(), "cargo"];
result::ok(path::connect_many(path))
}
fn get_cargo_root() -> result::t<path, str> {
fn get_cargo_root() -> result<path, str> {
alt os::getenv("CARGO_ROOT") {
some(_p) { result::ok(_p) }
none {
@@ -126,7 +126,7 @@ fn get_cargo_root() -> result::t<path, str> {
}
}
fn get_cargo_root_nearest() -> result::t<path, str> {
fn get_cargo_root_nearest() -> result<path, str> {
result::chain(get_cargo_root()) { |p|
let cwd = os::getcwd();
let dirname = path::dirname(cwd);
@@ -151,13 +151,13 @@ fn get_cargo_root_nearest() -> result::t<path, str> {
}
}
fn get_cargo_lib_path() -> result::t<path, str> {
fn get_cargo_lib_path() -> result<path, str> {
result::chain(get_cargo_root()) { |p|
result::ok(path::connect(p, libdir()))
}
}
fn get_cargo_lib_path_nearest() -> result::t<path, str> {
fn get_cargo_lib_path_nearest() -> result<path, str> {
result::chain(get_cargo_root_nearest()) { |p|
result::ok(path::connect(p, libdir()))
}