Rename Mac -> Macro
This is part of a move to standardize on abbreviating only those types in the
AST that are abbreviated in Rust source code, like `impl` or `fn`. The grammar
of Rust source code never abbreviates `macro` to `mac`, so this commit reflects
that.
Field names are being kept as `mac` because `macro` is a reserved word.
diff --git a/src/gen/fold.rs b/src/gen/fold.rs
index 8290450..b38f04c 100644
--- a/src/gen/fold.rs
+++ b/src/gen/fold.rs
@@ -236,7 +236,7 @@
# [ cfg ( feature = "full" ) ]
fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
# [ cfg ( feature = "full" ) ]
-fn fold_item_mac(&mut self, i: ItemMac) -> ItemMac { fold_item_mac(self, i) }
+fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
# [ cfg ( feature = "full" ) ]
fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -255,11 +255,11 @@
fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
# [ cfg ( feature = "full" ) ]
fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
-
-fn fold_mac(&mut self, i: Mac) -> Mac { fold_mac(self, i) }
# [ cfg ( feature = "full" ) ]
fn fold_mac_stmt_style(&mut self, i: MacStmtStyle) -> MacStmtStyle { fold_mac_stmt_style(self, i) }
+fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
+
fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
@@ -328,7 +328,7 @@
# [ cfg ( feature = "full" ) ]
fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
# [ cfg ( feature = "full" ) ]
-fn fold_trait_item_mac(&mut self, i: TraitItemMac) -> TraitItemMac { fold_trait_item_mac(self, i) }
+fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
# [ cfg ( feature = "full" ) ]
fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
# [ cfg ( feature = "full" ) ]
@@ -1116,9 +1116,9 @@
full!(_visitor.fold_expr_ret(_binding_0)),
)
}
- Mac(_binding_0, ) => {
- Mac (
- _visitor.fold_mac(_binding_0),
+ Macro(_binding_0, ) => {
+ Macro (
+ _visitor.fold_macro(_binding_0),
)
}
Struct(_binding_0, ) => {
@@ -1488,7 +1488,7 @@
}
Macro(_binding_0, ) => {
Macro (
- _visitor.fold_mac(_binding_0),
+ _visitor.fold_macro(_binding_0),
)
}
}
@@ -1616,9 +1616,9 @@
_visitor.fold_item_impl(_binding_0),
)
}
- Mac(_binding_0, ) => {
- Mac (
- _visitor.fold_item_mac(_binding_0),
+ Macro(_binding_0, ) => {
+ Macro (
+ _visitor.fold_item_macro(_binding_0),
)
}
}
@@ -1710,10 +1710,10 @@
}
}
# [ cfg ( feature = "full" ) ]
-pub fn fold_item_mac<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMac) -> ItemMac {
- ItemMac {
+pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
+ ItemMacro {
attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
- mac: _visitor.fold_mac(_i . mac),
+ mac: _visitor.fold_macro(_i . mac),
}
}
# [ cfg ( feature = "full" ) ]
@@ -1825,15 +1825,6 @@
attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
}
}
-
-pub fn fold_mac<V: Folder + ?Sized>(_visitor: &mut V, _i: Mac) -> Mac {
- Mac {
- path: _visitor.fold_path(_i . path),
- bang_token: _i . bang_token,
- ident: _i . ident,
- tokens: _i . tokens,
- }
-}
# [ cfg ( feature = "full" ) ]
pub fn fold_mac_stmt_style<V: Folder + ?Sized>(_visitor: &mut V, _i: MacStmtStyle) -> MacStmtStyle {
use ::MacStmtStyle::*;
@@ -1848,6 +1839,15 @@
}
}
+pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
+ Macro {
+ path: _visitor.fold_path(_i . path),
+ bang_token: _i . bang_token,
+ ident: _i . ident,
+ tokens: _i . tokens,
+ }
+}
+
pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
use ::MetaItem::*;
match _i {
@@ -1996,9 +1996,9 @@
_visitor.fold_pat_slice(_binding_0),
)
}
- Mac(_binding_0, ) => {
- Mac (
- _visitor.fold_mac(_binding_0),
+ Macro(_binding_0, ) => {
+ Macro (
+ _visitor.fold_macro(_binding_0),
)
}
}
@@ -2213,8 +2213,8 @@
_binding_1,
)
}
- Mac(_binding_0, ) => {
- Mac (
+ Macro(_binding_0, ) => {
+ Macro (
_binding_0,
)
}
@@ -2253,7 +2253,7 @@
}
Macro(_binding_0, ) => {
Macro (
- _visitor.fold_trait_item_mac(_binding_0),
+ _visitor.fold_trait_item_macro(_binding_0),
)
}
}
@@ -2271,10 +2271,10 @@
}
}
# [ cfg ( feature = "full" ) ]
-pub fn fold_trait_item_mac<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMac) -> TraitItemMac {
- TraitItemMac {
+pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
+ TraitItemMacro {
attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
- mac: _visitor.fold_mac(_i . mac),
+ mac: _visitor.fold_macro(_i . mac),
}
}
# [ cfg ( feature = "full" ) ]
@@ -2367,9 +2367,9 @@
_visitor.fold_ty_infer(_binding_0),
)
}
- Mac(_binding_0, ) => {
- Mac (
- _visitor.fold_mac(_binding_0),
+ Macro(_binding_0, ) => {
+ Macro (
+ _visitor.fold_macro(_binding_0),
)
}
}