about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorHaitao Li <lihaitao@gmail.com>2011-11-22 13:01:28 +0800
committerBrian Anderson <banderson@mozilla.com>2011-11-24 14:55:53 -0800
commit05b2cb8ecc30c6758f6042da7e3fc5c603be0f23 (patch)
treeb6a35b43b1571dead52893721db67e3fe5aa137a /src/comp
parent2253ed5d1c056dac47c2fbd9dfd399a655230db0 (diff)
downloadrust-05b2cb8ecc30c6758f6042da7e3fc5c603be0f23.tar.gz
rust-05b2cb8ecc30c6758f6042da7e3fc5c603be0f23.zip
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.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/syntax/parse/parser.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index df769033028..4f81a1dfe73 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -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";