Skip to content

Commit 50d9965

Browse files
committed
rename one of the two confusing MacroExpanders
There were two things named MacroExpander, which was confusing. I renamed one of them TTMacroExpander. [breaking change]
1 parent 3f3291e commit 50d9965

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/libsyntax/ext/base.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ pub struct BasicMacroExpander {
4848
pub span: Option<Span>
4949
}
5050

51-
pub trait MacroExpander {
51+
/// Represents a thing that maps token trees to Macro Results
52+
pub trait TTMacroExpander {
5253
fn expand(&self,
5354
ecx: &mut ExtCtxt,
5455
span: Span,
@@ -60,7 +61,7 @@ pub type MacroExpanderFn =
6061
fn(ecx: &mut ExtCtxt, span: codemap::Span, token_tree: &[ast::TokenTree])
6162
-> Box<MacResult>;
6263

63-
impl MacroExpander for BasicMacroExpander {
64+
impl TTMacroExpander for BasicMacroExpander {
6465
fn expand(&self,
6566
ecx: &mut ExtCtxt,
6667
span: Span,
@@ -259,7 +260,7 @@ pub enum SyntaxExtension {
259260
/// A normal, function-like syntax extension.
260261
///
261262
/// `bytes!` is a `NormalTT`.
262-
NormalTT(Box<MacroExpander + 'static>, Option<Span>),
263+
NormalTT(Box<TTMacroExpander + 'static>, Option<Span>),
263264

264265
/// A function-like syntax extension that has an extra ident before
265266
/// the block.

src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use ast::{TTDelim};
1313
use ast;
1414
use codemap::{Span, Spanned, DUMMY_SP};
1515
use ext::base::{ExtCtxt, MacResult, MacroDef};
16-
use ext::base::{NormalTT, MacroExpander};
16+
use ext::base::{NormalTT, TTMacroExpander};
1717
use ext::base;
1818
use ext::tt::macro_parser::{Success, Error, Failure};
1919
use ext::tt::macro_parser::{NamedMatch, MatchedSeq, MatchedNonterminal};
@@ -95,7 +95,7 @@ struct MacroRulesMacroExpander {
9595
rhses: Vec<Rc<NamedMatch>>,
9696
}
9797

98-
impl MacroExpander for MacroRulesMacroExpander {
98+
impl TTMacroExpander for MacroRulesMacroExpander {
9999
fn expand(&self,
100100
cx: &mut ExtCtxt,
101101
sp: Span,

0 commit comments

Comments
 (0)