Other delimiters

This commit is contained in:
Aleksey Kladov 2020-04-10 10:29:59 +02:00
parent 460c8bbdec
commit 548f562dda
3 changed files with 54 additions and 50 deletions

View File

@ -187,9 +187,9 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl TupleFieldDefList { impl TupleFieldDefList {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) } pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleFieldDef { pub struct TupleFieldDef {
@ -483,9 +483,9 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ParenType { impl ParenType {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleType { pub struct TupleType {
@ -503,9 +503,9 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl TupleType { impl TupleType {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) } pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct NeverType { pub struct NeverType {
@ -580,11 +580,11 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ArrayType { impl ArrayType {
pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) }
pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![;]) } pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![;]) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SliceType { pub struct SliceType {
@ -602,9 +602,9 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl SliceType { impl SliceType {
pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) }
pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ReferenceType { pub struct ReferenceType {
@ -742,9 +742,9 @@ fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ast::AttrsOwner for TupleExpr {} impl ast::AttrsOwner for TupleExpr {}
impl TupleExpr { impl TupleExpr {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ArrayExpr { pub struct ArrayExpr {
@ -763,10 +763,10 @@ fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ast::AttrsOwner for ArrayExpr {} impl ast::AttrsOwner for ArrayExpr {}
impl ArrayExpr { impl ArrayExpr {
pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) }
pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![;]) } pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![;]) }
pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParenExpr { pub struct ParenExpr {
@ -785,9 +785,9 @@ fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ast::AttrsOwner for ParenExpr {} impl ast::AttrsOwner for ParenExpr {}
impl ParenExpr { impl ParenExpr {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PathExpr { pub struct PathExpr {
@ -1095,8 +1095,8 @@ fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ast::AttrsOwner for IndexExpr {} impl ast::AttrsOwner for IndexExpr {}
impl IndexExpr { impl IndexExpr {
pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) }
pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FieldExpr { pub struct FieldExpr {
@ -1478,9 +1478,9 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ParenPat { impl ParenPat {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RefPat { pub struct RefPat {
@ -1614,9 +1614,9 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl SlicePat { impl SlicePat {
pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) }
pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RangePat { pub struct RangePat {
@ -1756,9 +1756,9 @@ fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl TupleStructPat { impl TupleStructPat {
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TuplePat { pub struct TuplePat {
@ -1776,9 +1776,9 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl TuplePat { impl TuplePat {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Visibility { pub struct Visibility {
@ -1879,11 +1879,11 @@ fn syntax(&self) -> &SyntaxNode { &self.syntax }
impl Attr { impl Attr {
pub fn pound_token(&self) -> Option<Pound> { support::token(&self.syntax) } pub fn pound_token(&self) -> Option<Pound> { support::token(&self.syntax) }
pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) }
pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) }
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) } pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) }
pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TokenTree { pub struct TokenTree {
@ -2186,10 +2186,10 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ParamList { impl ParamList {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SelfParam { pub struct SelfParam {
@ -2354,9 +2354,9 @@ fn cast(syntax: SyntaxNode) -> Option<Self> {
fn syntax(&self) -> &SyntaxNode { &self.syntax } fn syntax(&self) -> &SyntaxNode { &self.syntax }
} }
impl ArgList { impl ArgList {
pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) }
pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) } pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) }
} }
#[derive(Debug, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Path { pub struct Path {

View File

@ -338,7 +338,7 @@ struct UnionDef: VisibilityOwner, NameOwner, TypeParamsOwner, AttrsOwner, DocCom
struct RecordFieldDefList { T!['{'], fields: [RecordFieldDef], T!['}'] } struct RecordFieldDefList { T!['{'], fields: [RecordFieldDef], T!['}'] }
struct RecordFieldDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { } struct RecordFieldDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { }
struct TupleFieldDefList { LParen, fields: [TupleFieldDef], RParen } struct TupleFieldDefList { T!['('], fields: [TupleFieldDef], T![')'] }
struct TupleFieldDef: VisibilityOwner, AttrsOwner { struct TupleFieldDef: VisibilityOwner, AttrsOwner {
TypeRef, TypeRef,
} }
@ -411,13 +411,13 @@ struct ImplDef: TypeParamsOwner, AttrsOwner {
ItemList, ItemList,
} }
struct ParenType { LParen, TypeRef, RParen } struct ParenType { T!['('], TypeRef, T![')'] }
struct TupleType { LParen, fields: [TypeRef], RParen } struct TupleType { T!['('], fields: [TypeRef], T![')'] }
struct NeverType { Excl } struct NeverType { Excl }
struct PathType { Path } struct PathType { Path }
struct PointerType { Star, T![const], T![mut], TypeRef } struct PointerType { Star, T![const], T![mut], TypeRef }
struct ArrayType { LBrack, TypeRef, T![;], Expr, RBrack } struct ArrayType { T!['['], TypeRef, T![;], Expr, T![']'] }
struct SliceType { LBrack, TypeRef, RBrack } struct SliceType { T!['['], TypeRef, T![']'] }
struct ReferenceType { Amp, Lifetime, T![mut], TypeRef } struct ReferenceType { Amp, Lifetime, T![mut], TypeRef }
struct PlaceholderType { Underscore } struct PlaceholderType { Underscore }
struct FnPointerType { Abi, T![unsafe], T![fn], ParamList, RetType } struct FnPointerType { Abi, T![unsafe], T![fn], ParamList, RetType }
@ -425,9 +425,9 @@ struct ForType { T![for], TypeParamList, TypeRef }
struct ImplTraitType: TypeBoundsOwner { T![impl] } struct ImplTraitType: TypeBoundsOwner { T![impl] }
struct DynTraitType: TypeBoundsOwner { T![dyn] } struct DynTraitType: TypeBoundsOwner { T![dyn] }
struct TupleExpr: AttrsOwner { LParen, exprs: [Expr], RParen } struct TupleExpr: AttrsOwner { T!['('], exprs: [Expr], T![')'] }
struct ArrayExpr: AttrsOwner { LBrack, exprs: [Expr], T![;], RBrack } struct ArrayExpr: AttrsOwner { T!['['], exprs: [Expr], T![;], T![']'] }
struct ParenExpr: AttrsOwner { LParen, Expr, RParen } struct ParenExpr: AttrsOwner { T!['('], Expr, T![')'] }
struct PathExpr { Path } struct PathExpr { Path }
struct LambdaExpr: AttrsOwner { struct LambdaExpr: AttrsOwner {
T![static], T![static],
@ -456,7 +456,7 @@ struct CallExpr: ArgListOwner { Expr }
struct MethodCallExpr: AttrsOwner, ArgListOwner { struct MethodCallExpr: AttrsOwner, ArgListOwner {
Expr, Dot, NameRef, TypeArgList, Expr, Dot, NameRef, TypeArgList,
} }
struct IndexExpr: AttrsOwner { LBrack, RBrack } struct IndexExpr: AttrsOwner { T!['['], T![']'] }
struct FieldExpr: AttrsOwner { Expr, Dot, NameRef } struct FieldExpr: AttrsOwner { Expr, Dot, NameRef }
struct AwaitExpr: AttrsOwner { Expr, Dot, T![await] } struct AwaitExpr: AttrsOwner { Expr, Dot, T![await] }
struct TryExpr: AttrsOwner { T![try], Expr } struct TryExpr: AttrsOwner { T![try], Expr }
@ -489,14 +489,14 @@ struct RecordFieldList {
struct RecordField: AttrsOwner { NameRef, Colon, Expr } struct RecordField: AttrsOwner { NameRef, Colon, Expr }
struct OrPat { pats: [Pat] } struct OrPat { pats: [Pat] }
struct ParenPat { LParen, Pat, RParen } struct ParenPat { T!['('], Pat, T![')'] }
struct RefPat { Amp, T![mut], Pat } struct RefPat { Amp, T![mut], Pat }
struct BoxPat { T![box], Pat } struct BoxPat { T![box], Pat }
struct BindPat: AttrsOwner, NameOwner { T![ref], T![mut], At, Pat } struct BindPat: AttrsOwner, NameOwner { T![ref], T![mut], At, Pat }
struct PlaceholderPat { Underscore } struct PlaceholderPat { Underscore }
struct DotDotPat { Dotdot } struct DotDotPat { Dotdot }
struct PathPat { Path } struct PathPat { Path }
struct SlicePat { LBrack, args: [Pat], RBrack } struct SlicePat { T!['['], args: [Pat], T![']'] }
struct RangePat { RangeSeparator } struct RangePat { RangeSeparator }
struct LiteralPat { Literal } struct LiteralPat { Literal }
struct MacroPat { MacroCall } struct MacroPat { MacroCall }
@ -512,8 +512,8 @@ struct RecordFieldPatList {
} }
struct RecordFieldPat: AttrsOwner, NameOwner { Colon, Pat } struct RecordFieldPat: AttrsOwner, NameOwner { Colon, Pat }
struct TupleStructPat { Path, LParen, args: [Pat], RParen } struct TupleStructPat { Path, T!['('], args: [Pat], T![')'] }
struct TuplePat { LParen, args: [Pat], RParen } struct TuplePat { T!['('], args: [Pat], T![')'] }
struct Visibility { T![pub], T![super], T![self], T![crate] } struct Visibility { T![pub], T![super], T![self], T![crate] }
struct Name { Ident } struct Name { Ident }
@ -522,7 +522,7 @@ struct NameRef { NameRefToken }
struct MacroCall: NameOwner, AttrsOwner,DocCommentsOwner { struct MacroCall: NameOwner, AttrsOwner,DocCommentsOwner {
Path, Excl, TokenTree, T![;] Path, Excl, TokenTree, T![;]
} }
struct Attr { Pound, Excl, LBrack, Path, Eq, input: AttrInput, RBrack } struct Attr { Pound, Excl, T!['['], Path, Eq, input: AttrInput, T![']'] }
struct TokenTree {} struct TokenTree {}
struct TypeParamList { struct TypeParamList {
LAngle, LAngle,
@ -562,10 +562,10 @@ struct Block: AttrsOwner, ModuleItemOwner {
T!['}'], T!['}'],
} }
struct ParamList { struct ParamList {
LParen, T!['('],
SelfParam, SelfParam,
params: [Param], params: [Param],
RParen T![')']
} }
struct SelfParam: TypeAscriptionOwner, AttrsOwner { Amp, Lifetime, T![self] } struct SelfParam: TypeAscriptionOwner, AttrsOwner { Amp, Lifetime, T![self] }
struct Param: TypeAscriptionOwner, AttrsOwner { struct Param: TypeAscriptionOwner, AttrsOwner {
@ -585,9 +585,9 @@ struct ExternCrateItem: AttrsOwner, VisibilityOwner {
T![extern], T![crate], NameRef, Alias, T![extern], T![crate], NameRef, Alias,
} }
struct ArgList { struct ArgList {
LParen, T!['('],
args: [Expr], args: [Expr],
RParen T![')']
} }
struct Path { struct Path {
segment: PathSegment, segment: PathSegment,

View File

@ -531,6 +531,10 @@ fn method_name(&self) -> proc_macro2::Ident {
"->" => "thin_arrow", "->" => "thin_arrow",
"'{'" => "l_curly", "'{'" => "l_curly",
"'}'" => "r_curly", "'}'" => "r_curly",
"'('" => "l_paren",
"')'" => "r_paren",
"'['" => "l_brack",
"']'" => "r_brack",
_ => name, _ => name,
}; };
format_ident!("{}_token", name) format_ident!("{}_token", name)