Skip to content

Commit 60e30e8

Browse files
committed
---
yaml --- r: 22846 b: refs/heads/master c: a712597 h: refs/heads/master v: v3
1 parent 08a9dfa commit 60e30e8

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f6ce2bd83155a2fa3103d61229540649bfe8bc9d
2+
refs/heads/master: a7125971c652393af33fbc7121edfd4ecb7307eb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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));

trunk/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> {

trunk/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)