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:
@@ -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]),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user