std/rustc/rustpkg/syntax: Support the extern mod = ... form

This commit allows you to write:

 extern mod x = "a/b/c";

which means rustc will search in the RUST_PATH for a package with
ID a/b/c, and bind it to the name `x` if it's found.

Incidentally, move get_relative_to from back::rpath into std::path
This commit is contained in:
Tim Chevalier 2013-07-31 13:47:32 -07:00
parent e751c90513
commit 96fd606ddd
29 changed files with 819 additions and 602 deletions

View file

@ -12,9 +12,11 @@
use std::os;
use std::path::Path;
use path_util::{rust_path, workspace_contains_package_id};
use path_util::workspace_contains_package_id;
use package_id::PkgId;
use rustc::metadata::filesearch::rust_path;
pub fn each_pkg_parent_workspace(pkgid: &PkgId, action: &fn(&Path) -> bool) -> bool {
// Using the RUST_PATH, find workspaces that contain
// this package ID
@ -58,5 +60,5 @@ pub fn cwd_to_workspace() -> (Path, PkgId) {
let ws = cwd.pop().pop();
let cwd_ = cwd.clone();
let pkgid = cwd_.components.last().to_str();
(ws, PkgId::new(pkgid, &cwd))
(ws, PkgId::new(pkgid))
}