libsyntax: Make "pub use" mean the same thing as the former "import" in all circumstances
This commit is contained in:
parent
10c533861b
commit
e7fe903d88
|
@ -3267,7 +3267,7 @@ struct parser {
|
|||
visibility,
|
||||
maybe_append(attrs, extra_attrs)));
|
||||
} else if self.eat_keyword(~"use") {
|
||||
let view_item = self.parse_use();
|
||||
let view_item = self.parse_use(visibility);
|
||||
self.expect(token::SEMI);
|
||||
return iovi_view_item(@{
|
||||
node: view_item,
|
||||
|
@ -3327,9 +3327,9 @@ struct parser {
|
|||
}
|
||||
}
|
||||
|
||||
fn parse_use() -> view_item_ {
|
||||
if self.look_ahead(1) == token::SEMI ||
|
||||
self.look_ahead(1) == token::LPAREN {
|
||||
fn parse_use(vis: visibility) -> view_item_ {
|
||||
if vis != public && (self.look_ahead(1) == token::SEMI ||
|
||||
self.look_ahead(1) == token::LPAREN) {
|
||||
// Old-style "use"; i.e. what we now call "extern mod".
|
||||
let ident = self.parse_ident();
|
||||
let metadata = self.parse_optional_meta();
|
||||
|
@ -3445,7 +3445,7 @@ struct parser {
|
|||
fn parse_view_item(+attrs: ~[attribute]) -> @view_item {
|
||||
let lo = self.span.lo, vis = self.parse_visibility();
|
||||
let node = if self.eat_keyword(~"use") {
|
||||
self.parse_use()
|
||||
self.parse_use(vis)
|
||||
} else if self.eat_keyword(~"import") {
|
||||
view_item_import(self.parse_view_paths())
|
||||
} else if self.eat_keyword(~"export") {
|
||||
|
|
Loading…
Reference in New Issue