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

@@ -951,7 +951,11 @@ pub struct view_item {
#[deriving(Clone, Eq, Encodable, Decodable, IterBytes)]
pub enum view_item_ {
view_item_extern_mod(ident, ~[@MetaItem], NodeId),
// ident: name used to refer to this crate in the code
// optional @str: if present, this is a location (containing
// arbitrary characters) from which to fetch the crate sources
// For example, extern mod whatever = "github.com/mozilla/rust"
view_item_extern_mod(ident, Option<@str>, ~[@MetaItem], NodeId),
view_item_use(~[@view_path]),
}