mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2025-03-01 03:45:47 +00:00
Rename angle bracketed generic argumnents colon2 token
This commit is contained in:
parent
7641851182
commit
2d4e08ab32
@ -418,7 +418,7 @@ pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKi
|
||||
|
||||
pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
|
||||
AngleBracketedGenericArguments {
|
||||
turbofish: (_i . turbofish).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
|
||||
colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
|
||||
lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
|
||||
args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
|
||||
gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
|
||||
|
@ -409,7 +409,7 @@ pub fn visit_abi_kind<'ast, V: Visitor<'ast> + ?Sized>(_visitor: &mut V, _i: &'a
|
||||
}
|
||||
|
||||
pub fn visit_angle_bracketed_generic_arguments<'ast, V: Visitor<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast AngleBracketedGenericArguments) {
|
||||
if let Some(ref it) = _i . turbofish { tokens_helper(_visitor, &(it).0) };
|
||||
if let Some(ref it) = _i . colon2_token { tokens_helper(_visitor, &(it).0) };
|
||||
tokens_helper(_visitor, &(& _i . lt_token).0);
|
||||
for el in & _i . args { let it = el.item(); _visitor.visit_generic_argument(it) };
|
||||
tokens_helper(_visitor, &(& _i . gt_token).0);
|
||||
|
@ -409,7 +409,7 @@ pub fn visit_abi_kind_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut Abi
|
||||
}
|
||||
|
||||
pub fn visit_angle_bracketed_generic_arguments_mut<V: VisitorMut + ?Sized>(_visitor: &mut V, _i: &mut AngleBracketedGenericArguments) {
|
||||
if let Some(ref mut it) = _i . turbofish { tokens_helper(_visitor, &mut (it).0) };
|
||||
if let Some(ref mut it) = _i . colon2_token { tokens_helper(_visitor, &mut (it).0) };
|
||||
tokens_helper(_visitor, &mut (& mut _i . lt_token).0);
|
||||
for mut el in & mut _i . args { let it = el.item_mut(); _visitor.visit_generic_argument_mut(it) };
|
||||
tokens_helper(_visitor, &mut (& mut _i . gt_token).0);
|
||||
|
@ -214,7 +214,7 @@ ast_enum! {
|
||||
ast_struct! {
|
||||
/// A path like `Foo<'a, T>`
|
||||
pub struct AngleBracketedGenericArguments {
|
||||
pub turbofish: Option<Token![::]>,
|
||||
pub colon2_token: Option<Token![::]>,
|
||||
pub lt_token: Token![<],
|
||||
pub args: Delimited<GenericArgument, Token![,]>,
|
||||
pub gt_token: Token![>],
|
||||
@ -703,12 +703,12 @@ pub mod parsing {
|
||||
|
||||
impl Synom for AngleBracketedGenericArguments {
|
||||
named!(parse -> Self, do_parse!(
|
||||
turbofish: option!(punct!(::)) >>
|
||||
colon2: option!(punct!(::)) >>
|
||||
lt: punct!(<) >>
|
||||
args: call!(Delimited::parse_terminated) >>
|
||||
gt: punct!(>) >>
|
||||
(AngleBracketedGenericArguments {
|
||||
turbofish: turbofish,
|
||||
colon2_token: colon2,
|
||||
lt_token: lt,
|
||||
args: args,
|
||||
gt_token: gt,
|
||||
@ -1050,7 +1050,7 @@ mod printing {
|
||||
|
||||
impl ToTokens for AngleBracketedGenericArguments {
|
||||
fn to_tokens(&self, tokens: &mut Tokens) {
|
||||
self.turbofish.to_tokens(tokens);
|
||||
self.colon2_token.to_tokens(tokens);
|
||||
self.lt_token.to_tokens(tokens);
|
||||
self.args.to_tokens(tokens);
|
||||
self.gt_token.to_tokens(tokens);
|
||||
|
Loading…
x
Reference in New Issue
Block a user