Standardize on tt name for tokens
diff --git a/src/expr.rs b/src/expr.rs
index 6578aff..55c2e4f 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -2032,7 +2032,7 @@
mac: Macro {
path: what,
bang_token: bang,
- tokens: proc_macro2::TokenTree {
+ tt: proc_macro2::TokenTree {
span: (data.1).0,
kind: TokenNode::Group(Delimiter::Brace, data.0),
},
diff --git a/src/gen/fold.rs b/src/gen/fold.rs
index 1ce2f31..11e071f 100644
--- a/src/gen/fold.rs
+++ b/src/gen/fold.rs
@@ -1946,7 +1946,7 @@
Macro {
path: _visitor.fold_path(_i . path),
bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
- tokens: _i . tokens,
+ tt: _i . tt,
}
}
diff --git a/src/gen/visit.rs b/src/gen/visit.rs
index 72ef863..3ca692f 100644
--- a/src/gen/visit.rs
+++ b/src/gen/visit.rs
@@ -1535,7 +1535,7 @@
pub fn visit_macro<'ast, V: Visitor<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Macro) {
_visitor.visit_path(& _i . path);
tokens_helper(_visitor, &(& _i . bang_token).0);
- // Skipped field _i . tokens;
+ // Skipped field _i . tt;
}
pub fn visit_member<'ast, V: Visitor<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast Member) {
diff --git a/src/gen/visit_mut.rs b/src/gen/visit_mut.rs
index 8b13b47..d804e2c 100644
--- a/src/gen/visit_mut.rs
+++ b/src/gen/visit_mut.rs
@@ -1535,7 +1535,7 @@
pub fn visit_macro_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut Macro) {
_visitor.visit_path_mut(& mut _i . path);
tokens_helper(_visitor, &mut (& mut _i . bang_token).0);
- // Skipped field _i . tokens;
+ // Skipped field _i . tt;
}
pub fn visit_member_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut Member) {
diff --git a/src/item.rs b/src/item.rs
index 0672dcc..82c7924 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -592,7 +592,7 @@
mac: Macro {
path: what,
bang_token: bang,
- tokens: body,
+ tt: body,
},
semi_token: semi,
})
@@ -1209,7 +1209,7 @@
impl_synom!(TraitItemMacro "trait item macro" do_parse!(
attrs: many0!(Attribute::parse_outer) >>
mac: syn!(Macro) >>
- semi: cond!(!is_braced(&mac.tokens), punct!(;)) >>
+ semi: cond!(!is_braced(&mac.tt), punct!(;)) >>
(TraitItemMacro {
attrs: attrs,
mac: mac,
@@ -1362,7 +1362,7 @@
impl_synom!(ImplItemMacro "macro in impl block" do_parse!(
attrs: many0!(Attribute::parse_outer) >>
mac: syn!(Macro) >>
- semi: cond!(!is_braced(&mac.tokens), punct!(;)) >>
+ semi: cond!(!is_braced(&mac.tt), punct!(;)) >>
(ImplItemMacro {
attrs: attrs,
mac: mac,
@@ -1608,7 +1608,7 @@
self.mac.path.to_tokens(tokens);
self.mac.bang_token.to_tokens(tokens);
self.ident.to_tokens(tokens);
- self.mac.tokens.to_tokens(tokens);
+ self.mac.tt.to_tokens(tokens);
self.semi_token.to_tokens(tokens);
}
}
diff --git a/src/mac.rs b/src/mac.rs
index e013f92..98aa49a 100644
--- a/src/mac.rs
+++ b/src/mac.rs
@@ -14,7 +14,7 @@
pub struct Macro #manual_extra_traits {
pub path: Path,
pub bang_token: Token![!],
- pub tokens: TokenTree,
+ pub tt: TokenTree,
}
}
@@ -25,7 +25,7 @@
impl PartialEq for Macro {
fn eq(&self, other: &Self) -> bool {
self.path == other.path && self.bang_token == other.bang_token
- && TokenTreeHelper(&self.tokens) == TokenTreeHelper(&other.tokens)
+ && TokenTreeHelper(&self.tt) == TokenTreeHelper(&other.tt)
}
}
@@ -37,7 +37,7 @@
{
self.path.hash(state);
self.bang_token.hash(state);
- TokenTreeHelper(&self.tokens).hash(state);
+ TokenTreeHelper(&self.tt).hash(state);
}
}
@@ -167,7 +167,7 @@
(Macro {
path: what,
bang_token: bang,
- tokens: body,
+ tt: body,
})
));
}
@@ -182,7 +182,7 @@
fn to_tokens(&self, tokens: &mut Tokens) {
self.path.to_tokens(tokens);
self.bang_token.to_tokens(tokens);
- self.tokens.to_tokens(tokens);
+ self.tt.to_tokens(tokens);
}
}
}