Skip to content

Commit a712597

Browse files
committed
Rename #mod -> #module to not collide with the keyword.
1 parent f6ce2bd commit a712597

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/libsyntax/ext/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn syntax_expander_table() -> hashmap<~str, syntax_extension> {
103103
builtin(ext::source_util::expand_include_str));
104104
syntax_expanders.insert(~"include_bin",
105105
builtin(ext::source_util::expand_include_bin));
106-
syntax_expanders.insert(~"mod",
106+
syntax_expanders.insert(~"module",
107107
builtin(ext::source_util::expand_mod));
108108
syntax_expanders.insert(~"proto",
109109
builtin_item_tt(ext::pipes::expand_proto));

src/libsyntax/ext/expand.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ fn expand_mod_items(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
162162
ret {items: new_items with module};
163163
}
164164

165-
// Support for item-position macro invocations, exactly the same
166-
// logic as for expression-position macro invocations.
165+
166+
// When we enter a module, record it, for the sake of `module!`
167167
fn expand_item(exts: hashmap<~str, syntax_extension>,
168168
cx: ext_ctxt, &&it: @ast::item, fld: ast_fold,
169169
orig: fn@(&&@ast::item, ast_fold) -> option<@ast::item>)
@@ -191,6 +191,9 @@ fn expand_item(exts: hashmap<~str, syntax_extension>,
191191
}
192192
}
193193

194+
195+
// Support for item-position macro invocations, exactly the same
196+
// logic as for expression-position macro invocations.
194197
fn expand_item_mac(exts: hashmap<~str, syntax_extension>,
195198
cx: ext_ctxt, &&it: @ast::item,
196199
fld: ast_fold) -> option<@ast::item> {

src/test/run-pass/syntax-extension-source-utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
mod m1 {
55
mod m2 {
6-
fn where_am_i() -> ~str { #mod[] }
6+
fn where_am_i() -> ~str { #module[] }
77
}
88
}
99

0 commit comments

Comments
 (0)