mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2024-11-27 01:41:05 +00:00
Update generated code
This commit is contained in:
parent
a42ba9156c
commit
6ba911d9da
@ -56,10 +56,6 @@ pub trait Fold {
|
||||
fold_bare_fn_arg(self, i)
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName {
|
||||
fold_bare_fn_arg_name(self, i)
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
fn fold_bin_op(&mut self, i: BinOp) -> BinOp {
|
||||
fold_bin_op(self, i)
|
||||
}
|
||||
@ -874,7 +870,7 @@ where
|
||||
attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
|
||||
name: (node.name).map(|it| {
|
||||
(
|
||||
f.fold_bare_fn_arg_name((it).0),
|
||||
f.fold_ident((it).0),
|
||||
Token ! [ : ](tokens_helper(f, &(it).1.spans)),
|
||||
)
|
||||
}),
|
||||
@ -882,18 +878,6 @@ where
|
||||
}
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
pub fn fold_bare_fn_arg_name<F>(f: &mut F, node: BareFnArgName) -> BareFnArgName
|
||||
where
|
||||
F: Fold + ?Sized,
|
||||
{
|
||||
match node {
|
||||
BareFnArgName::Named(_binding_0) => BareFnArgName::Named(f.fold_ident(_binding_0)),
|
||||
BareFnArgName::Wild(_binding_0) => {
|
||||
BareFnArgName::Wild(Token![_](tokens_helper(f, &_binding_0.spans)))
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
pub fn fold_bin_op<F>(f: &mut F, node: BinOp) -> BinOp
|
||||
where
|
||||
F: Fold + ?Sized,
|
||||
|
@ -57,10 +57,6 @@ pub trait Visit<'ast> {
|
||||
visit_bare_fn_arg(self, i)
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
fn visit_bare_fn_arg_name(&mut self, i: &'ast BareFnArgName) {
|
||||
visit_bare_fn_arg_name(self, i)
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
fn visit_bin_op(&mut self, i: &'ast BinOp) {
|
||||
visit_bin_op(self, i)
|
||||
}
|
||||
@ -875,26 +871,12 @@ where
|
||||
v.visit_attribute(it)
|
||||
}
|
||||
if let Some(it) = &node.name {
|
||||
v.visit_bare_fn_arg_name(&(it).0);
|
||||
v.visit_ident(&(it).0);
|
||||
tokens_helper(v, &(it).1.spans);
|
||||
};
|
||||
v.visit_type(&node.ty);
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
pub fn visit_bare_fn_arg_name<'ast, V>(v: &mut V, node: &'ast BareFnArgName)
|
||||
where
|
||||
V: Visit<'ast> + ?Sized,
|
||||
{
|
||||
match node {
|
||||
BareFnArgName::Named(_binding_0) => {
|
||||
v.visit_ident(_binding_0);
|
||||
}
|
||||
BareFnArgName::Wild(_binding_0) => {
|
||||
tokens_helper(v, &_binding_0.spans);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
pub fn visit_bin_op<'ast, V>(v: &mut V, node: &'ast BinOp)
|
||||
where
|
||||
V: Visit<'ast> + ?Sized,
|
||||
|
@ -61,10 +61,6 @@ pub trait VisitMut {
|
||||
visit_bare_fn_arg_mut(self, i)
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
fn visit_bare_fn_arg_name_mut(&mut self, i: &mut BareFnArgName) {
|
||||
visit_bare_fn_arg_name_mut(self, i)
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
fn visit_bin_op_mut(&mut self, i: &mut BinOp) {
|
||||
visit_bin_op_mut(self, i)
|
||||
}
|
||||
@ -879,26 +875,12 @@ where
|
||||
v.visit_attribute_mut(it)
|
||||
}
|
||||
if let Some(it) = &mut node.name {
|
||||
v.visit_bare_fn_arg_name_mut(&mut (it).0);
|
||||
v.visit_ident_mut(&mut (it).0);
|
||||
tokens_helper(v, &mut (it).1.spans);
|
||||
};
|
||||
v.visit_type_mut(&mut node.ty);
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
pub fn visit_bare_fn_arg_name_mut<V>(v: &mut V, node: &mut BareFnArgName)
|
||||
where
|
||||
V: VisitMut + ?Sized,
|
||||
{
|
||||
match node {
|
||||
BareFnArgName::Named(_binding_0) => {
|
||||
v.visit_ident_mut(_binding_0);
|
||||
}
|
||||
BareFnArgName::Wild(_binding_0) => {
|
||||
tokens_helper(v, &mut _binding_0.spans);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(any(feature = "derive", feature = "full"))]
|
||||
pub fn visit_bin_op_mut<V>(v: &mut V, node: &mut BinOp)
|
||||
where
|
||||
V: VisitMut + ?Sized,
|
||||
|
23
syn.json
23
syn.json
@ -156,7 +156,7 @@
|
||||
"option": {
|
||||
"tuple": [
|
||||
{
|
||||
"syn": "BareFnArgName"
|
||||
"proc_macro2": "Ident"
|
||||
},
|
||||
{
|
||||
"token": "Colon"
|
||||
@ -169,27 +169,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ident": "BareFnArgName",
|
||||
"features": {
|
||||
"any": [
|
||||
"derive",
|
||||
"full"
|
||||
]
|
||||
},
|
||||
"variants": {
|
||||
"Named": [
|
||||
{
|
||||
"proc_macro2": "Ident"
|
||||
}
|
||||
],
|
||||
"Wild": [
|
||||
{
|
||||
"token": "Underscore"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"ident": "BinOp",
|
||||
"features": {
|
||||
|
@ -120,7 +120,7 @@ impl Debug for Lite<syn::BareFnArg> {
|
||||
if let Some(val) = &_val.name {
|
||||
#[derive(RefCast)]
|
||||
#[repr(transparent)]
|
||||
struct Print((syn::BareFnArgName, syn::token::Colon));
|
||||
struct Print((proc_macro2::Ident, syn::token::Colon));
|
||||
impl Debug for Print {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
formatter.write_str("Some")?;
|
||||
@ -137,24 +137,6 @@ impl Debug for Lite<syn::BareFnArg> {
|
||||
formatter.finish()
|
||||
}
|
||||
}
|
||||
impl Debug for Lite<syn::BareFnArgName> {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
let _val = &self.value;
|
||||
match _val {
|
||||
syn::BareFnArgName::Named(_val) => {
|
||||
formatter.write_str("Named")?;
|
||||
formatter.write_str("(")?;
|
||||
Debug::fmt(Lite(_val), formatter)?;
|
||||
formatter.write_str(")")?;
|
||||
Ok(())
|
||||
}
|
||||
syn::BareFnArgName::Wild(_val) => {
|
||||
formatter.write_str("Wild")?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Debug for Lite<syn::BinOp> {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
let _val = &self.value;
|
||||
|
Loading…
Reference in New Issue
Block a user