diff options
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 13b5739e..82b6d813 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -1,6 +1,7 @@ import std.map.hashmap; import std.option; +import std._str; import std._vec; import util.common.span; import util.common.spanned; @@ -529,6 +530,27 @@ fn index_stmt(block_index index, @stmt s) { } } +fn is_exported(ident i, _mod m) -> bool { + auto count = 0; + for (@ast.view_item vi in m.view_items) { + alt (vi.node) { + case (ast.view_item_export(?id)) { + if (_str.eq(i, id)) { + ret true; + } + count += 1; + } + case (_) { /* fall through */ } + } + } + // If there are no declared exports then everything is exported + if (count == 0) { + ret true; + } else { + ret false; + } +} + fn is_call_expr(@expr e) -> bool { alt (e.node) { case (expr_call(_, _, _)) { |