Briefer ast traversal trait names
diff --git a/codegen/README.md b/codegen/README.md
index 7c7960f..df46bd2 100644
--- a/codegen/README.md
+++ b/codegen/README.md
@@ -2,8 +2,8 @@
This is an internal (not published on crates.io) crate which is used to generate
the files in the `gen/` directory of `syn`. It is used to ensure that the
-implementations for `Folder`, `Visitor`, and `VisitorMut` remain in sync with
-the actual AST.
+implementations for `Fold`, `Visit`, and `VisitMut` remain in sync with the
+actual AST.
To run this program, run `cargo run` in this directory, and the `gen/` folder
will be re-generated.
diff --git a/codegen/src/main.rs b/codegen/src/main.rs
index e849d66..6e3c72f 100644
--- a/codegen/src/main.rs
+++ b/codegen/src/main.rs
@@ -1,5 +1,5 @@
-//! This crate automatically generates the definition of the `Visitor`,
-//! `VisitorMut`, and `Folder` traits in `syn` based on the `syn` source. It
+//! This crate automatically generates the definition of the `Visit`,
+//! `VisitMut`, and `Fold` traits in `syn` based on the `syn` source. It
//! discovers structs and enums declared with the `ast_*` macros and generates
//! the functions for those types.
//!
@@ -727,7 +727,7 @@
state.visit_impl.push_str(&format!(
"{features}\n\
- pub fn visit_{under_name}<'ast, V: Visitor<'ast> + ?Sized>(\
+ pub fn visit_{under_name}<'ast, V: Visit<'ast> + ?Sized>(\
_visitor: &mut V, _i: &'ast {ty}) {{\n",
features = s.features,
under_name = under_name,
@@ -735,7 +735,7 @@
));
state.visit_mut_impl.push_str(&format!(
"{features}\n\
- pub fn visit_{under_name}_mut<V: VisitorMut + ?Sized>(\
+ pub fn visit_{under_name}_mut<V: VisitMut + ?Sized>(\
_visitor: &mut V, _i: &mut {ty}) {{\n",
features = s.features,
under_name = under_name,
@@ -744,7 +744,7 @@
let before_fold_impl_len = state.fold_impl.len();
state.fold_impl.push_str(&format!(
"{features}\n\
- pub fn fold_{under_name}<V: Folder + ?Sized>(\
+ pub fn fold_{under_name}<V: Fold + ?Sized>(\
_visitor: &mut V, _i: {ty}) -> {ty} {{\n",
features = s.features,
under_name = under_name,
@@ -1006,7 +1006,7 @@
"\
// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
-//! A Folder represents an AST->AST fold; it accepts an AST piece,
+//! A Fold represents an AST->AST fold; it accepts an AST piece,
//! and returns a piece of the same type.
#![cfg_attr(rustfmt, rustfmt_skip)]
@@ -1026,7 +1026,7 @@
/// AST->AST fold.
///
-/// Each method of the Folder trait is a hook to be potentially overridden. Each
+/// Each method of the Fold trait is a hook to be potentially overridden. Each
/// method's default implementation recursively visits the substructure of the
/// input via the `walk` functions, which perform an \"identity fold\", that
/// is, they return the same structure that they are given (for example the
@@ -1034,15 +1034,15 @@
///
/// If you want to ensure that your code handles every variant
/// explicitly, you need to override each method. (And you also need
-/// to monitor future changes to `Folder` in case a new method with a
+/// to monitor future changes to `Fold` in case a new method with a
/// new default implementation gets introduced.)
-pub trait Folder {{
+pub trait Fold {{
{fold_trait}
}}
macro_rules! fold_span_only {{
($f:ident : $t:ident) => {{
- pub fn $f<V: Folder + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {{
+ pub fn $f<V: Fold + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {{
_i.span = _visitor.fold_span(_i.span);
_i
}}
@@ -1096,16 +1096,16 @@
{full_macro}
-/// Each method of the Visitor trait is a hook to be potentially
+/// Each method of the Visit trait is a hook to be potentially
/// overridden. Each method's default implementation recursively visits
/// the substructure of the input via the corresponding `walk` method;
/// e.g. the `visit_mod` method by default calls `visit::walk_mod`.
///
/// If you want to ensure that your code handles every variant
/// explicitly, you need to override each method. (And you also need
-/// to monitor future changes to `Visitor` in case a new method with a
+/// to monitor future changes to `Visit` in case a new method with a
/// new default implementation gets introduced.)
-pub trait Visitor<'ast> {{
+pub trait Visit<'ast> {{
{visit_trait}
}}
@@ -1140,16 +1140,16 @@
{full_macro}
-/// Each method of the VisitorMut trait is a hook to be potentially
+/// Each method of the VisitMut trait is a hook to be potentially
/// overridden. Each method's default implementation recursively visits
/// the substructure of the input via the corresponding `walk` method;
/// e.g. the `visit_mod` method by default calls `visit::walk_mod`.
///
/// If you want to ensure that your code handles every variant
/// explicitly, you need to override each method. (And you also need
-/// to monitor future changes to `VisitorMut` in case a new method with a
+/// to monitor future changes to `VisitMut` in case a new method with a
/// new default implementation gets introduced.)
-pub trait VisitorMut {{
+pub trait VisitMut {{
{visit_mut_trait}
}}