提交 50d9965c 编写于 作者: J John Clements

rename one of the two confusing MacroExpanders

There were two things named MacroExpander, which was confusing. I renamed
one of them TTMacroExpander.

[breaking change]
上级 3f3291e0
......@@ -48,7 +48,8 @@ pub struct BasicMacroExpander {
pub span: Option<Span>
}
pub trait MacroExpander {
/// Represents a thing that maps token trees to Macro Results
pub trait TTMacroExpander {
fn expand(&self,
ecx: &mut ExtCtxt,
span: Span,
......@@ -60,7 +61,7 @@ fn expand(&self,
fn(ecx: &mut ExtCtxt, span: codemap::Span, token_tree: &[ast::TokenTree])
-> Box<MacResult>;
impl MacroExpander for BasicMacroExpander {
impl TTMacroExpander for BasicMacroExpander {
fn expand(&self,
ecx: &mut ExtCtxt,
span: Span,
......@@ -259,7 +260,7 @@ pub enum SyntaxExtension {
/// A normal, function-like syntax extension.
///
/// `bytes!` is a `NormalTT`.
NormalTT(Box<MacroExpander + 'static>, Option<Span>),
NormalTT(Box<TTMacroExpander + 'static>, Option<Span>),
/// A function-like syntax extension that has an extra ident before
/// the block.
......
......@@ -13,7 +13,7 @@
use ast;
use codemap::{Span, Spanned, DUMMY_SP};
use ext::base::{ExtCtxt, MacResult, MacroDef};
use ext::base::{NormalTT, MacroExpander};
use ext::base::{NormalTT, TTMacroExpander};
use ext::base;
use ext::tt::macro_parser::{Success, Error, Failure};
use ext::tt::macro_parser::{NamedMatch, MatchedSeq, MatchedNonterminal};
......@@ -95,7 +95,7 @@ struct MacroRulesMacroExpander {
rhses: Vec<Rc<NamedMatch>>,
}
impl MacroExpander for MacroRulesMacroExpander {
impl TTMacroExpander for MacroRulesMacroExpander {
fn expand(&self,
cx: &mut ExtCtxt,
sp: Span,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册