Convert std::fs to istrs. Issue #855

This commit is contained in:
Brian Anderson
2011-08-24 16:00:26 -07:00
parent 051f1ff562
commit c2eafd268b
13 changed files with 121 additions and 80 deletions

View File

@@ -1,5 +1,6 @@
import std::str;
import std::istr;
import std::option;
import std::option::some;
import std::option::none;
@@ -48,10 +49,12 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str,
ast::cdir_src_mod(id, file_opt, attrs) {
let file_path = id + ".rs";
alt file_opt { some(f) { file_path = f; } none. { } }
let full_path =
if std::fs::path_is_absolute(file_path) {
file_path
} else { prefix + std::fs::path_sep() + file_path };
let full_path = if std::fs::path_is_absolute(
istr::from_estr(file_path)) {
file_path
} else {
prefix + istr::to_estr(std::fs::path_sep()) + file_path
};
if cx.mode == mode_depend { cx.deps += [full_path]; ret; }
let p0 =
new_parser_from_file(cx.sess, cx.cfg, full_path, cx.chpos,
@@ -73,9 +76,9 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str,
let path = id;
alt dir_opt { some(d) { path = d; } none. { } }
let full_path =
if std::fs::path_is_absolute(path) {
if std::fs::path_is_absolute(istr::from_estr(path)) {
path
} else { prefix + std::fs::path_sep() + path };
} else { prefix + istr::to_estr(std::fs::path_sep()) + path };
let m0 = eval_crate_directives_to_mod(cx, cdirs, full_path);
let i =
@{ident: id,