Plumbing and parsing for item-position macros.

This commit is contained in:
Eric Holk 2012-07-05 12:10:33 -07:00
parent a787f40013
commit 05cdda3a2c
19 changed files with 135 additions and 10 deletions

View file

@ -217,6 +217,7 @@ fn encode_module_item_paths(ebml_w: ebml::writer, ecx: @encode_ctxt,
}
}
item_impl(*) {}
item_mac(*) { fail "item macros unimplemented" }
}
}
}
@ -749,6 +750,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
encode_path(ebml_w, path, ast_map::path_name(item.ident));
ebml_w.end_tag();
}
item_mac(*) { fail "item macros unimplemented" }
}
}

View file

@ -1352,6 +1352,7 @@ fn found_def_item(i: @ast::item, ns: namespace) -> option<def> {
}
}
ast::item_impl(*) { /* ??? */ }
ast::item_mac(*) { fail "item macros unimplemented" }
}
ret none;
}
@ -1658,6 +1659,9 @@ fn index_mod(md: ast::_mod) -> mod_index {
// add the class name itself
add_to_index(index, it.ident, mie_item(it));
}
ast::item_mac(*) {
fail "item macros unimplemented"
}
}
}
ret index;

View file

@ -13,7 +13,7 @@ import syntax::ast::{expr_binary, expr_cast, expr_field, expr_fn};
import syntax::ast::{expr_fn_block, expr_index, expr_new, expr_path};
import syntax::ast::{expr_unary, fn_decl, foreign_item, foreign_item_fn};
import syntax::ast::{ident, trait_ref, impure_fn, instance_var, item};
import syntax::ast::{item_class, item_const, item_enum, item_fn};
import syntax::ast::{item_class, item_const, item_enum, item_fn, item_mac};
import syntax::ast::{item_foreign_mod, item_trait, item_impl, item_mod};
import syntax::ast::{item_ty, local, local_crate, method, node_id, pat};
import syntax::ast::{pat_enum, pat_ident, path, prim_ty, stmt_decl, ty};
@ -871,6 +871,10 @@ class Resolver {
(*name_bindings).define_type(def_ty(local_def(item.id)));
visit_item(item, new_parent, visitor);
}
item_mac(*) {
fail "item macros unimplemented"
}
}
}
@ -2854,6 +2858,10 @@ class Resolver {
item_const(*) {
visit_item(item, (), visitor);
}
item_mac(*) {
fail "item macros unimplemented"
}
}
self.xray_context = orig_xray_flag;

View file

@ -148,6 +148,7 @@ fn traverse_public_item(cx: ctx, item: @item) {
}
item_const(*) |
item_enum(*) | item_trait(*) {}
item_mac(*) { fail "item macros unimplemented" }
}
}

View file

@ -55,6 +55,7 @@ fn find_pre_post_item(ccx: crate_ctxt, i: item) {
item_impl(_, _, _, _, ms) {
for ms.each |m| { find_pre_post_method(ccx, m); }
}
item_mac(*) { fail "item macros unimplemented" }
}
}

View file

@ -537,6 +537,7 @@ fn ty_of_item(ccx: @crate_ctxt, it: @ast::item)
}
ast::item_impl(*) | ast::item_mod(_) |
ast::item_foreign_mod(_) { fail; }
ast::item_mac(*) { fail "item macros unimplemented" }
}
}