rustc: Accepts `path` attributes for crate directives

Temporarily allow path specified in either as attribute or in AST, like:

  #[path = "mymod.rs"]
  mod mymod = "mymod.rs";

This is a transitional commit to avoid creating a stage1 snapshot.
This commit is contained in:
Haitao Li 2011-11-22 13:01:28 +08:00 committed by Brian Anderson
parent 2253ed5d1c
commit 05b2cb8ecc
1 changed files with 3 additions and 1 deletions

View File

@ -2478,7 +2478,9 @@ fn parse_crate_directive(p: parser, first_outer_attr: [ast::attribute]) ->
let file_opt =
alt p.peek() {
token::EQ. { p.bump(); some(parse_str(p)) }
_ { none }
_ {
attr::get_meta_item_value_str_by_name(outer_attrs, "path")
}
};
alt p.peek() {
// mod x = "foo.rs";