Skip to content

Commit 1808d74

Browse files
committed
Alias HashMap<~str, SyntaxExtension> to SyntaxExtensions
1 parent 27e235b commit 1808d74

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/libsyntax/ext/base.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ pub enum SyntaxExtension {
7575
ItemTT(SyntaxExpanderTTItem),
7676
}
7777

78+
type SyntaxExtensions = HashMap<~str, SyntaxExtension>;
79+
7880
// A temporary hard-coded map of methods for expanding syntax extension
7981
// AST nodes into full ASTs
80-
pub fn syntax_expander_table() -> HashMap<~str, SyntaxExtension> {
82+
pub fn syntax_expander_table() -> SyntaxExtensions {
8183
// utility function to simplify creating NormalTT syntax extensions
8284
fn builtin_normal_tt(f: SyntaxExpanderTTFun) -> SyntaxExtension {
8385
NormalTT(SyntaxExpanderTT{expander: f, span: None})

src/libsyntax/ext/expand.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use core::option;
2323
use core::vec;
2424
use std::oldmap::HashMap;
2525

26-
pub fn expand_expr(exts: HashMap<~str, SyntaxExtension>, cx: ext_ctxt,
26+
pub fn expand_expr(exts: SyntaxExtensions, cx: ext_ctxt,
2727
e: expr_, s: span, fld: ast_fold,
2828
orig: fn@(expr_, span, ast_fold) -> (expr_, span))
2929
-> (expr_, span) {
@@ -88,7 +88,7 @@ pub fn expand_expr(exts: HashMap<~str, SyntaxExtension>, cx: ext_ctxt,
8888
//
8989
// NB: there is some redundancy between this and expand_item, below, and
9090
// they might benefit from some amount of semantic and language-UI merger.
91-
pub fn expand_mod_items(exts: HashMap<~str, SyntaxExtension>, cx: ext_ctxt,
91+
pub fn expand_mod_items(exts: SyntaxExtensions, cx: ext_ctxt,
9292
module_: ast::_mod, fld: ast_fold,
9393
orig: fn@(ast::_mod, ast_fold) -> ast::_mod)
9494
-> ast::_mod {
@@ -121,7 +121,7 @@ pub fn expand_mod_items(exts: HashMap<~str, SyntaxExtension>, cx: ext_ctxt,
121121

122122

123123
// When we enter a module, record it, for the sake of `module!`
124-
pub fn expand_item(exts: HashMap<~str, SyntaxExtension>,
124+
pub fn expand_item(exts: SyntaxExtensions,
125125
cx: ext_ctxt, &&it: @ast::item, fld: ast_fold,
126126
orig: fn@(&&v: @ast::item, ast_fold) -> Option<@ast::item>)
127127
-> Option<@ast::item> {
@@ -147,7 +147,7 @@ pub fn expand_item(exts: HashMap<~str, SyntaxExtension>,
147147

148148
// Support for item-position macro invocations, exactly the same
149149
// logic as for expression-position macro invocations.
150-
pub fn expand_item_mac(exts: HashMap<~str, SyntaxExtension>,
150+
pub fn expand_item_mac(exts: SyntaxExtensions,
151151
cx: ext_ctxt, &&it: @ast::item,
152152
fld: ast_fold) -> Option<@ast::item> {
153153

@@ -206,7 +206,7 @@ pub fn expand_item_mac(exts: HashMap<~str, SyntaxExtension>,
206206
return maybe_it;
207207
}
208208
209-
pub fn expand_stmt(exts: HashMap<~str, SyntaxExtension>, cx: ext_ctxt,
209+
pub fn expand_stmt(exts: SyntaxExtensions, cx: ext_ctxt,
210210
&& s: stmt_, sp: span, fld: ast_fold,
211211
orig: fn@(&&s: stmt_, span, ast_fold) -> (stmt_, span))
212212
-> (stmt_, span) {

0 commit comments

Comments
 (0)