Permalink
Browse files

Rename std::istr to std::str. Issue #855

  • Loading branch information...
brson committed Sep 2, 2011
1 parent 913667b commit ab6bb035e50f735cb36cc1959e5a097f076a3b74
Showing with 741 additions and 741 deletions.
  1. +20 −20 src/comp/back/link.rs
  2. +1 −1 src/comp/back/upcall.rs
  3. +7 −7 src/comp/back/x86.rs
  4. +30 −30 src/comp/driver/rustc.rs
  5. +1 −1 src/comp/driver/session.rs
  6. +1 −1 src/comp/front/attr.rs
  7. +1 −1 src/comp/front/test.rs
  8. +3 −3 src/comp/lib/llvm.rs
  9. +2 −2 src/comp/metadata/common.rs
  10. +5 −5 src/comp/metadata/creader.rs
  11. +2 −2 src/comp/metadata/cstore.rs
  12. +11 −11 src/comp/metadata/decoder.rs
  13. +13 −13 src/comp/metadata/encoder.rs
  14. +5 −5 src/comp/metadata/tydecode.rs
  15. +1 −1 src/comp/metadata/tyencode.rs
  16. +1 −1 src/comp/middle/alias.rs
  17. +1 −1 src/comp/middle/freevars.rs
  18. +2 −2 src/comp/middle/gc.rs
  19. +1 −1 src/comp/middle/kind.rs
  20. +2 −2 src/comp/middle/mut.rs
  21. +15 −15 src/comp/middle/resolve.rs
  22. +3 −3 src/comp/middle/shape.rs
  23. +37 −37 src/comp/middle/trans.rs
  24. +4 −4 src/comp/middle/trans_alt.rs
  25. +81 −81 src/comp/middle/trans_build.rs
  26. +13 −13 src/comp/middle/trans_common.rs
  27. +1 −1 src/comp/middle/trans_ivec.rs
  28. +8 −8 src/comp/middle/trans_objects.rs
  29. +1 −1 src/comp/middle/tstate/annotate.rs
  30. +1 −1 src/comp/middle/tstate/auxiliary.rs
  31. +1 −1 src/comp/middle/tstate/ck.rs
  32. +1 −1 src/comp/middle/tstate/collect_locals.rs
  33. +1 −1 src/comp/middle/tstate/pre_post_conditions.rs
  34. +1 −1 src/comp/middle/tstate/states.rs
  35. +9 −9 src/comp/middle/ty.rs
  36. +4 −4 src/comp/middle/typeck.rs
  37. +3 −3 src/comp/syntax/ast_util.rs
  38. +10 −10 src/comp/syntax/codemap.rs
  39. +1 −1 src/comp/syntax/ext/base.rs
  40. +1 −1 src/comp/syntax/ext/env.rs
  41. +1 −1 src/comp/syntax/ext/expand.rs
  42. +1 −1 src/comp/syntax/ext/ident_to_str.rs
  43. +2 −2 src/comp/syntax/ext/ifmt.rs
  44. +1 −1 src/comp/syntax/ext/log_syntax.rs
  45. +1 −1 src/comp/syntax/ext/simplext.rs
  46. +1 −1 src/comp/syntax/parse/eval.rs
  47. +28 −28 src/comp/syntax/parse/lexer.rs
  48. +14 −14 src/comp/syntax/parse/parser.rs
  49. +3 −3 src/comp/syntax/parse/token.rs
  50. +2 −2 src/comp/syntax/print/pp.rs
  51. +10 −10 src/comp/syntax/print/pprust.rs
  52. +2 −2 src/comp/util/common.rs
  53. +9 −9 src/comp/util/ppaux.rs
  54. +5 −5 src/fuzzer/fuzzer.rs
  55. +2 −2 src/lib/aio.rs
  56. +27 −27 src/lib/extifmt.rs
  57. +14 −14 src/lib/fs.rs
  58. +9 −9 src/lib/generic_os.rs
  59. +11 −11 src/lib/getopts.rs
  60. +17 −17 src/lib/io.rs
  61. +8 −8 src/lib/linux_os.rs
  62. +8 −8 src/lib/macos_os.rs
  63. +1 −1 src/lib/map.rs
  64. +1 −1 src/lib/net.rs
  65. +1 −1 src/lib/posix_fs.rs
  66. +4 −4 src/lib/run_program.rs
  67. +1 −1 src/lib/sha1.rs
  68. +1 −1 src/lib/std.rc
  69. 0 src/lib/{istr.rs → str.rs}
  70. +1 −1 src/lib/term.rs
  71. +2 −2 src/lib/test.rs
  72. +4 −4 src/lib/uint.rs
  73. +2 −2 src/lib/win32_fs.rs
  74. +6 −6 src/lib/win32_os.rs
  75. +3 −3 src/test/bench/99bob-iter.rs
  76. +1 −1 src/test/bench/99bob-pattern.rs
  77. +3 −3 src/test/bench/99bob-simple.rs
  78. +1 −1 src/test/bench/99bob-tail.rs
  79. +8 −8 src/test/bench/shootout-fasta.rs
  80. +2 −2 src/test/bench/shootout-pfib.rs
  81. +2 −2 src/test/bench/task-perf-spawnalot.rs
  82. +2 −2 src/test/bench/task-perf-vector-party.rs
  83. +5 −5 src/test/bench/task-perf-word-count-generic.rs
  84. +2 −2 src/test/bench/task-perf-word-count.rs
  85. +1 −1 src/test/compile-fail/fn-constraint.rs
  86. +1 −1 src/test/compile-fail/no-constraint-prop.rs
  87. +4 −4 src/test/compiletest/compiletest.rs
  88. +8 −8 src/test/compiletest/header.rs
  89. +7 −7 src/test/compiletest/procsrv.rs
  90. +11 −11 src/test/compiletest/runtest.rs
  91. +1 −1 src/test/compiletest/util.rs
  92. +1 −1 src/test/run-fail/fn-constraint.rs
  93. +1 −1 src/test/run-pass/constraint-prop-expr-move.rs
  94. +1 −1 src/test/run-pass/constraint-prop-move.rs
  95. +1 −1 src/test/run-pass/constraint-prop-swap.rs
  96. +1 −1 src/test/run-pass/constraint-prop.rs
  97. +1 −1 src/test/run-pass/fn-constraint.rs
  98. +3 −3 src/test/run-pass/hashmap-memory.rs
  99. +2 −2 src/test/run-pass/spawn-types.rs
  100. +3 −3 src/test/run-pass/str-append.rs
  101. +3 −3 src/test/run-pass/str-multiline.rs
  102. +3 −3 src/test/run-pass/string-self-append.rs
  103. +2 −2 src/test/run-pass/syntax-extension-fmt.rs
  104. +20 −20 src/test/run-pass/utf8_chars.rs
  105. +1 −1 src/test/stdtest/int.rs
  106. +2 −2 src/test/stdtest/io.rs
  107. +20 −20 src/test/stdtest/map.rs
  108. +2 −2 src/test/stdtest/run.rs
  109. +3 −3 src/test/stdtest/sha1.rs
  110. +98 −98 src/test/stdtest/str.rs
  111. +2 −2 src/test/stdtest/test.rs
  112. +3 −3 src/test/stdtest/treemap.rs
View
@@ -5,7 +5,7 @@ import front::attr;
import middle::ty;
import metadata::encoder;
import middle::trans_common::crate_ctxt;
-import std::istr;
+import std::str;
import std::fs;
import std::vec;
import std::option;
@@ -37,15 +37,15 @@ fn llvm_err(sess: session::session, msg: &istr) {
sess.fatal(msg);
} else {
sess.fatal(
- msg + ~": " + istr::str_from_cstr(buf));
+ msg + ~": " + str::str_from_cstr(buf));
}
}
fn link_intrinsics(sess: session::session, llmod: ModuleRef) {
let path =
fs::connect(sess.get_opts().sysroot,
~"lib/intrinsics.bc");
- let membuf = istr::as_buf(path, { |buf|
+ let membuf = str::as_buf(path, { |buf|
llvm::LLVMRustCreateMemoryBufferWithContentsOfFile(buf)
});
if membuf as uint == 0u {
@@ -78,11 +78,11 @@ mod write {
// Decides what to call an intermediate file, given the name of the output
// and the extension to use.
fn mk_intermediate_name(output_path: &istr, extension: &istr) -> istr {
- let dot_pos = istr::index(output_path, '.' as u8);
+ let dot_pos = str::index(output_path, '.' as u8);
let stem;
if dot_pos < 0 {
stem = output_path;
- } else { stem = istr::substr(output_path, 0u, dot_pos as uint); }
+ } else { stem = str::substr(output_path, 0u, dot_pos as uint); }
ret stem + ~"." + extension;
}
fn run_passes(sess: session::session, llmod: ModuleRef, output: &istr) {
@@ -103,14 +103,14 @@ mod write {
output_type_bitcode. {
if opts.optimize != 0u {
let filename = mk_intermediate_name(output, ~"no-opt.bc");
- istr::as_buf(filename, { |buf|
+ str::as_buf(filename, { |buf|
llvm::LLVMWriteBitcodeToFile(llmod, buf)
});
}
}
_ {
let filename = mk_intermediate_name(output, ~"bc");
- istr::as_buf(filename, { |buf|
+ str::as_buf(filename, { |buf|
llvm::LLVMWriteBitcodeToFile(llmod, buf)
});
}
@@ -185,16 +185,16 @@ mod write {
let filename = mk_intermediate_name(output, ~"opt.bc");
llvm::LLVMRunPassManager(pm.llpm, llmod);
- istr::as_buf(filename, { |buf|
+ str::as_buf(filename, { |buf|
llvm::LLVMWriteBitcodeToFile(llmod, buf)
});
pm = mk_pass_manager();
// Save the assembly file if -S is used
if opts.output_type == output_type_assembly {
let _: () =
- istr::as_buf(x86::get_target_triple(), { |buf_t|
- istr::as_buf(output, { |buf_o|
+ str::as_buf(x86::get_target_triple(), { |buf_t|
+ str::as_buf(output, { |buf_o|
llvm::LLVMRustWriteOutputFile(
pm.llpm, llmod,
buf_t,
@@ -210,8 +210,8 @@ mod write {
if opts.output_type == output_type_object ||
opts.output_type == output_type_exe {
let _: () =
- istr::as_buf(x86::get_target_triple(), { |buf_t|
- istr::as_buf(output, { |buf_o|
+ str::as_buf(x86::get_target_triple(), { |buf_t|
+ str::as_buf(output, { |buf_o|
llvm::LLVMRustWriteOutputFile(
pm.llpm, llmod,
buf_t,
@@ -224,8 +224,8 @@ mod write {
// If we aren't saving temps then just output the file
// type corresponding to the '-c' or '-S' flag used
- let _: () = istr::as_buf(x86::get_target_triple(), { |buf_t|
- istr::as_buf(output, { |buf_o|
+ let _: () = str::as_buf(x86::get_target_triple(), { |buf_t|
+ str::as_buf(output, { |buf_o|
llvm::LLVMRustWriteOutputFile(pm.llpm, llmod,
buf_t,
buf_o,
@@ -243,7 +243,7 @@ mod write {
// flag, then output it here
llvm::LLVMRunPassManager(pm.llpm, llmod);
- istr::as_buf(output, { |buf|
+ str::as_buf(output, { |buf|
llvm::LLVMWriteBitcodeToFile(llmod, buf)
});
llvm::LLVMDisposeModule(llmod);
@@ -340,7 +340,7 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &istr,
fn crate_meta_extras_hash(sha: sha1, _crate: &ast::crate,
metas: &provided_metas) -> istr {
fn len_and_str(s: &istr) -> istr {
- ret #ifmt["%u_%s", istr::byte_len(s), s];
+ ret #ifmt["%u_%s", str::byte_len(s), s];
}
fn len_and_str_lit(l: &ast::lit) -> istr {
@@ -383,12 +383,12 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &istr,
none. {
let name =
{
- let os = istr::split(
+ let os = str::split(
fs::basename(output),
'.' as u8);
assert (vec::len(os) >= 2u);
vec::pop(os);
- istr::connect(os, ~".")
+ str::connect(os, ~".")
};
warn_missing(sess, ~"name", name);
name
@@ -417,7 +417,7 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &istr,
}
fn truncated_sha1_result(sha: sha1) -> istr {
- ret istr::substr(sha.result_str(), 0u, 16u);
+ ret str::substr(sha.result_str(), 0u, 16u);
}
@@ -458,7 +458,7 @@ fn mangle(ss: &[istr]) -> istr {
let n = ~"_ZN"; // Begin name-sequence.
for s: istr in ss {
- n += #ifmt["%u%s", istr::byte_len(s), s];
+ n += #ifmt["%u%s", str::byte_len(s), s];
}
n += ~"E"; // End name-sequence.
View
@@ -1,5 +1,5 @@
-import std::istr;
+import std::str;
import middle::trans;
import trans::decl_cdecl_fn;
import middle::trans_common::T_f32;
View
@@ -1,34 +1,34 @@
import lib::llvm::llvm;
import lib::llvm::llvm::ModuleRef;
-import std::istr;
+import std::str;
import std::os::target_os;
fn get_module_asm() -> istr { ret ~""; }
fn get_meta_sect_name() -> istr {
- if istr::eq(target_os(), ~"macos") { ret ~"__DATA,__note.rustc"; }
- if istr::eq(target_os(), ~"win32") { ret ~".note.rustc"; }
+ if str::eq(target_os(), ~"macos") { ret ~"__DATA,__note.rustc"; }
+ if str::eq(target_os(), ~"win32") { ret ~".note.rustc"; }
ret ~".note.rustc";
}
fn get_data_layout() -> istr {
- if istr::eq(target_os(), ~"macos") {
+ if str::eq(target_os(), ~"macos") {
ret ~"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16" +
~"-i32:32:32-i64:32:64" +
~"-f32:32:32-f64:32:64-v64:64:64" +
~"-v128:128:128-a0:0:64-f80:128:128" +
~"-n8:16:32";
}
- if istr::eq(target_os(), ~"win32") {
+ if str::eq(target_os(), ~"win32") {
ret ~"e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32";
}
ret ~"e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32";
}
fn get_target_triple() -> istr {
- if istr::eq(target_os(), ~"macos") { ret ~"i686-apple-darwin"; }
- if istr::eq(target_os(), ~"win32") { ret ~"i686-pc-mingw32"; }
+ if str::eq(target_os(), ~"macos") { ret ~"i686-apple-darwin"; }
+ if str::eq(target_os(), ~"win32") { ret ~"i686-pc-mingw32"; }
ret ~"i686-unknown-linux-gnu";
}
//
View
@@ -26,7 +26,7 @@ import std::map::mk_hashmap;
import std::option;
import std::option::some;
import std::option::none;
-import std::istr;
+import std::str;
import std::vec;
import std::int;
import std::io;
@@ -107,7 +107,7 @@ fn parse_input_src(sess: session::session, cfg: &ast::crate_cfg,
if infile != ~"-" {
io::file_reader(infile)
} else { io::stdin() }.read_whole_stream();
- let src = istr::unsafe_from_bytes(srcbytes);
+ let src = str::unsafe_from_bytes(srcbytes);
let crate =
parser::parse_crate_from_source_str(
infile,
@@ -260,7 +260,7 @@ fn version(argv0: &istr) {
// FIXME: Restore after istr conversion
//let env_vers = #env["CFG_VERSION"];
let env_vers = ~"FIXME";
- if istr::byte_len(env_vers) != 0u { vers = env_vers; }
+ if str::byte_len(env_vers) != 0u { vers = env_vers; }
io::stdout().write_str(
#ifmt["%s %s\n",
argv0,
@@ -307,40 +307,40 @@ options:
}
fn get_os(triple: &istr) -> session::os {
- ret if istr::find(triple, ~"win32") >= 0 ||
- istr::find(triple, ~"mingw32") >= 0 {
+ ret if str::find(triple, ~"win32") >= 0 ||
+ str::find(triple, ~"mingw32") >= 0 {
session::os_win32
- } else if istr::find(triple, ~"darwin") >= 0 {
+ } else if str::find(triple, ~"darwin") >= 0 {
session::os_macos
- } else if istr::find(triple, ~"linux") >= 0 {
+ } else if str::find(triple, ~"linux") >= 0 {
session::os_linux
} else { log_err ~"Unknown operating system!"; fail };
}
fn get_arch(triple: &istr) -> session::arch {
- ret if istr::find(triple, ~"i386") >= 0 ||
- istr::find(triple, ~"i486") >= 0 ||
- istr::find(triple, ~"i586") >= 0 ||
- istr::find(triple, ~"i686") >= 0 ||
- istr::find(triple, ~"i786") >= 0 {
+ ret if str::find(triple, ~"i386") >= 0 ||
+ str::find(triple, ~"i486") >= 0 ||
+ str::find(triple, ~"i586") >= 0 ||
+ str::find(triple, ~"i686") >= 0 ||
+ str::find(triple, ~"i786") >= 0 {
session::arch_x86
- } else if istr::find(triple, ~"x86_64") >= 0 {
+ } else if str::find(triple, ~"x86_64") >= 0 {
session::arch_x64
- } else if istr::find(triple, ~"arm") >= 0 ||
- istr::find(triple, ~"xscale") >= 0 {
+ } else if str::find(triple, ~"arm") >= 0 ||
+ str::find(triple, ~"xscale") >= 0 {
session::arch_arm
} else { log_err ~"Unknown architecture! " + triple; fail };
}
fn get_default_sysroot(binary: &istr) -> istr {
let dirname = fs::dirname(binary);
- if istr::eq(dirname, binary) { ret ~"."; }
+ if str::eq(dirname, binary) { ret ~"."; }
ret dirname;
}
fn build_target_config() -> @session::config {
let triple: istr =
- istr::str_from_cstr(llvm::llvm::LLVMRustGetHostTriple());
+ str::str_from_cstr(llvm::llvm::LLVMRustGetHostTriple());
let target_cfg: @session::config =
@{os: get_os(triple),
arch: get_arch(triple),
@@ -442,13 +442,13 @@ fn build_session(sopts: @session::options) -> session::session {
}
fn parse_pretty(sess: session::session, name: &istr) -> pp_mode {
- if istr::eq(name, ~"normal") {
+ if str::eq(name, ~"normal") {
ret ppm_normal;
- } else if istr::eq(name, ~"expanded") {
+ } else if str::eq(name, ~"expanded") {
ret ppm_expanded;
- } else if istr::eq(name, ~"typed") {
+ } else if str::eq(name, ~"typed") {
ret ppm_typed;
- } else if istr::eq(name, ~"identified") { ret ppm_identified; }
+ } else if str::eq(name, ~"identified") { ret ppm_identified; }
sess.fatal(~"argument to `pretty` must be one of `normal`, `typed`, or "
+ ~"`identified`");
}
@@ -533,10 +533,10 @@ fn main(args: [istr]) {
// We want to toss everything after the final '.'
let parts =
if !input_is_stdin(ifile) {
- istr::split(ifile, '.' as u8)
+ str::split(ifile, '.' as u8)
} else { [~"default", ~"rs"] };
vec::pop(parts);
- saved_out_filename = istr::connect(parts, ~".");
+ saved_out_filename = str::connect(parts, ~".");
let suffix =
alt sopts.output_type {
link::output_type_none. { ~"none" }
@@ -591,15 +591,15 @@ fn main(args: [istr]) {
bind fn (config: @session::config, filename: &istr) -> istr {
if config.os == session::os_macos ||
config.os == session::os_linux &&
- istr::find(filename, ~"lib") == 0 {
- ret istr::slice(filename, 3u,
- istr::byte_len(filename));
+ str::find(filename, ~"lib") == 0 {
+ ret str::slice(filename, 3u,
+ str::byte_len(filename));
} else { ret filename; }
}(config, _);
fn rmext(filename: &istr) -> istr {
- let parts = istr::split(filename, '.' as u8);
+ let parts = str::split(filename, '.' as u8);
vec::pop(parts);
- ret istr::connect(parts, ~".");
+ ret str::connect(parts, ~".");
}
ret alt config.os {
session::os_macos. { rmext(rmlib(filename)) }
@@ -610,7 +610,7 @@ fn main(args: [istr]) {
let cstore = sess.get_cstore();
for cratepath: istr in cstore::get_used_crate_files(cstore) {
- if istr::ends_with(cratepath, ~".rlib") {
+ if str::ends_with(cratepath, ~".rlib") {
gcc_args += [cratepath];
cont;
}
@@ -641,7 +641,7 @@ fn main(args: [istr]) {
#ifmt["linking with gcc failed with code %d", err_code]);
sess.note(
#ifmt["gcc arguments: %s",
- istr::connect(gcc_args, ~" ")]);
+ str::connect(gcc_args, ~" ")]);
sess.abort_if_errors();
}
// Clean up on Darwin
@@ -9,7 +9,7 @@ import std::map;
import std::option;
import std::option::some;
import std::option::none;
-import std::istr;
+import std::str;
import syntax::parse::parser::parse_sess;
tag os { os_win32; os_macos; os_linux; }
View
@@ -1,7 +1,7 @@
// Functions dealing with attributes and meta_items
import std::vec;
-import std::istr;
+import std::str;
import std::map;
import std::option;
import syntax::ast;
View
@@ -2,7 +2,7 @@
import std::option;
import std::vec;
-import std::istr;
+import std::str;
import syntax::ast;
import syntax::ast_util;
import syntax::ast_util::*;
View
@@ -1,6 +1,6 @@
import std::vec;
-import std::istr;
-import std::istr::sbuf;
+import std::str;
+import std::str::sbuf;
import llvm::ModuleRef;
import llvm::ContextRef;
@@ -1070,7 +1070,7 @@ resource target_data_res(TD: TargetDataRef) {
type target_data = {lltd: TargetDataRef, dtor: @target_data_res};
fn mk_target_data(string_rep: &istr) -> target_data {
- let lltd = istr::as_buf(string_rep, { |buf|
+ let lltd = str::as_buf(string_rep, { |buf|
llvm::LLVMCreateTargetData(buf)
});
ret {lltd: lltd, dtor: @target_data_res(lltd)};
Oops, something went wrong.

0 comments on commit ab6bb03

Please sign in to comment.