Rename #mod -> #module to not collide with the keyword.

This commit is contained in:
Paul Stansifer 2012-07-27 11:19:21 -07:00
parent f6ce2bd831
commit a7125971c6
3 changed files with 7 additions and 4 deletions

View File

@ -103,7 +103,7 @@ fn builtin_item_tt(f: syntax_expander_tt_item_) -> syntax_extension {
builtin(ext::source_util::expand_include_str));
syntax_expanders.insert(~"include_bin",
builtin(ext::source_util::expand_include_bin));
syntax_expanders.insert(~"mod",
syntax_expanders.insert(~"module",
builtin(ext::source_util::expand_mod));
syntax_expanders.insert(~"proto",
builtin_item_tt(ext::pipes::expand_proto));

View File

@ -162,8 +162,8 @@ fn expand_mod_items(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
ret {items: new_items with module};
}
// Support for item-position macro invocations, exactly the same
// logic as for expression-position macro invocations.
// When we enter a module, record it, for the sake of `module!`
fn expand_item(exts: hashmap<~str, syntax_extension>,
cx: ext_ctxt, &&it: @ast::item, fld: ast_fold,
orig: fn@(&&@ast::item, ast_fold) -> option<@ast::item>)
@ -191,6 +191,9 @@ fn expand_item(exts: hashmap<~str, syntax_extension>,
}
}
// Support for item-position macro invocations, exactly the same
// logic as for expression-position macro invocations.
fn expand_item_mac(exts: hashmap<~str, syntax_extension>,
cx: ext_ctxt, &&it: @ast::item,
fld: ast_fold) -> option<@ast::item> {

View File

@ -3,7 +3,7 @@
mod m1 {
mod m2 {
fn where_am_i() -> ~str { #mod[] }
fn where_am_i() -> ~str { #module[] }
}
}