Skip to content

Commit 08ae1b2

Browse files
committed
---
yaml --- r: 4758 b: refs/heads/master c: 67cc5b9 h: refs/heads/master v: v3
1 parent b9524cd commit 08ae1b2

File tree

5 files changed

+32
-11
lines changed

5 files changed

+32
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: c95e3ab6a8bdaf5c73b7addbda5af0e2e7e24a10
2+
refs/heads/master: 67cc5b9e346cba9cc8fdaa00e38ef26b4d9936cf

trunk/src/comp/syntax/ast.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ tag view_item_ {
564564
view_item_use(ident, [@meta_item], node_id);
565565
view_item_import(ident, [ident], node_id);
566566
view_item_import_glob([ident], node_id);
567-
view_item_export(ident, node_id);
567+
view_item_export([ident], node_id);
568568
}
569569

570570
type obj_def_ids = {ty: node_id, ctor: node_id};
@@ -627,11 +627,11 @@ fn is_exported(i: ident, m: _mod) -> bool {
627627
let count = 0u;
628628
for vi: @ast::view_item in m.view_items {
629629
alt vi.node {
630-
ast::view_item_export(id, _) {
631-
if str::eq(i, id) {
632-
// even if it's nonlocal (since it's explicit)
633-
634-
ret true;
630+
ast::view_item_export(ids, _) {
631+
for id in ids {
632+
if str::eq(i, id) {
633+
ret true;
634+
}
635635
}
636636
count += 1u;
637637
}
@@ -640,7 +640,7 @@ fn is_exported(i: ident, m: _mod) -> bool {
640640
}
641641
// If there are no declared exports then
642642
// everything not imported is exported
643-
643+
// even if it's nonlocal (since it's explicit)
644644
ret count == 0u && !nonlocal;
645645
}
646646

trunk/src/comp/syntax/parse/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,8 +2353,9 @@ fn parse_import(p: &parser) -> ast::view_item_ {
23532353
}
23542354

23552355
fn parse_export(p: &parser) -> ast::view_item_ {
2356-
let id = parse_ident(p);
2357-
ret ast::view_item_export(id, p.get_id());
2356+
let ids = parse_seq_to_before_end(
2357+
token::SEMI, option::some(token::COMMA), parse_ident, p);
2358+
ret ast::view_item_export(ids, p.get_id());
23582359
}
23592360

23602361
fn parse_view_item(p: &parser) -> @ast::view_item {

trunk/src/comp/syntax/print/pprust.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,11 @@ fn print_view_item(s: &ps, item: &@ast::view_item) {
12761276
}
12771277
word(s.s, "::*");
12781278
}
1279-
ast::view_item_export(id, _) { head(s, "export"); word(s.s, id); }
1279+
ast::view_item_export(ids, _) {
1280+
head(s, "export");
1281+
commasep(s, inconsistent, ids,
1282+
fn(s: &ps, w: &str) { word(s.s, w) });
1283+
}
12801284
}
12811285
word(s.s, ";");
12821286
end(s); // end inner head-block
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import m::f;
2+
import m::g;
3+
4+
mod m {
5+
export f, g;
6+
7+
fn f() {}
8+
fn g() {}
9+
}
10+
11+
fn main() {
12+
f();
13+
g();
14+
m::f();
15+
m::g();
16+
}

0 commit comments

Comments
 (0)