diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-27 11:19:21 -0700 |
|---|---|---|
| committer | Paul Stansifer <paul.stansifer@gmail.com> | 2012-07-30 18:04:18 -0700 |
| commit | a7125971c652393af33fbc7121edfd4ecb7307eb (patch) | |
| tree | 2bf747516d3ee240d1526a25fca0bdb39c171eea /src/libsyntax | |
| parent | f6ce2bd83155a2fa3103d61229540649bfe8bc9d (diff) | |
| download | rust-a7125971c652393af33fbc7121edfd4ecb7307eb.tar.gz rust-a7125971c652393af33fbc7121edfd4ecb7307eb.zip | |
Rename `#mod` -> `#module` to not collide with the keyword.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index b35bd9a17e9..4a2bdf4cde5 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -103,7 +103,7 @@ fn syntax_expander_table() -> hashmap<~str, 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)); diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index caa5fd417a8..38d6477a2f9 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -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> { |
