mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 11:23:03 +00:00
rename one of the two confusing MacroExpanders
There were two things named MacroExpander, which was confusing. I renamed one of them TTMacroExpander. [breaking change]
This commit is contained in:
parent
3f3291e0c7
commit
50d9965c25
@ -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 @@ pub type MacroExpanderFn =
|
||||
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::{TTDelim};
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user