From 05b2cb8ecc30c6758f6042da7e3fc5c603be0f23 Mon Sep 17 00:00:00 2001 From: Haitao Li Date: Tue, 22 Nov 2011 13:01:28 +0800 Subject: [PATCH] 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. --- src/comp/syntax/parse/parser.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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";