diff options
author | Aleksey Kladov <[email protected]> | 2020-04-10 09:29:59 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-10 15:10:28 +0100 |
commit | 548f562ddad3bca515b304f82e110aeb319591e3 (patch) | |
tree | 71da0dc60264eee24fa809539f9d218b3c4c4a17 | |
parent | 460c8bbdec8561a581d035f9767b7dd1ba36cfd7 (diff) |
Other delimiters
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 64 | ||||
-rw-r--r-- | xtask/src/ast_src.rs | 36 | ||||
-rw-r--r-- | xtask/src/codegen/gen_syntax.rs | 4 |
3 files changed, 54 insertions, 50 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 3c917257c..0ae5db9fc 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -187,9 +187,9 @@ impl AstNode for TupleFieldDefList { | |||
187 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 187 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
188 | } | 188 | } |
189 | impl TupleFieldDefList { | 189 | impl TupleFieldDefList { |
190 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 190 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
191 | pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) } | 191 | pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) } |
192 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 192 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
193 | } | 193 | } |
194 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 194 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
195 | pub struct TupleFieldDef { | 195 | pub struct TupleFieldDef { |
@@ -483,9 +483,9 @@ impl AstNode for ParenType { | |||
483 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 483 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
484 | } | 484 | } |
485 | impl ParenType { | 485 | impl ParenType { |
486 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 486 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
487 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 487 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
488 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 488 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
489 | } | 489 | } |
490 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 490 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
491 | pub struct TupleType { | 491 | pub struct TupleType { |
@@ -503,9 +503,9 @@ impl AstNode for TupleType { | |||
503 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 503 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
504 | } | 504 | } |
505 | impl TupleType { | 505 | impl TupleType { |
506 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 506 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
507 | pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) } | 507 | pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) } |
508 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 508 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
509 | } | 509 | } |
510 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 510 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
511 | pub struct NeverType { | 511 | pub struct NeverType { |
@@ -580,11 +580,11 @@ impl AstNode for ArrayType { | |||
580 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 580 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
581 | } | 581 | } |
582 | impl ArrayType { | 582 | impl ArrayType { |
583 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 583 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) } |
584 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 584 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
585 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![;]) } | 585 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![;]) } |
586 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 586 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
587 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 587 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) } |
588 | } | 588 | } |
589 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 589 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
590 | pub struct SliceType { | 590 | pub struct SliceType { |
@@ -602,9 +602,9 @@ impl AstNode for SliceType { | |||
602 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 602 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
603 | } | 603 | } |
604 | impl SliceType { | 604 | impl SliceType { |
605 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 605 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) } |
606 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 606 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
607 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 607 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) } |
608 | } | 608 | } |
609 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 609 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
610 | pub struct ReferenceType { | 610 | pub struct ReferenceType { |
@@ -742,9 +742,9 @@ impl AstNode for TupleExpr { | |||
742 | } | 742 | } |
743 | impl ast::AttrsOwner for TupleExpr {} | 743 | impl ast::AttrsOwner for TupleExpr {} |
744 | impl TupleExpr { | 744 | impl TupleExpr { |
745 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 745 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
746 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 746 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
747 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 747 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
748 | } | 748 | } |
749 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 749 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
750 | pub struct ArrayExpr { | 750 | pub struct ArrayExpr { |
@@ -763,10 +763,10 @@ impl AstNode for ArrayExpr { | |||
763 | } | 763 | } |
764 | impl ast::AttrsOwner for ArrayExpr {} | 764 | impl ast::AttrsOwner for ArrayExpr {} |
765 | impl ArrayExpr { | 765 | impl ArrayExpr { |
766 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 766 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) } |
767 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 767 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
768 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![;]) } | 768 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![;]) } |
769 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 769 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) } |
770 | } | 770 | } |
771 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 771 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
772 | pub struct ParenExpr { | 772 | pub struct ParenExpr { |
@@ -785,9 +785,9 @@ impl AstNode for ParenExpr { | |||
785 | } | 785 | } |
786 | impl ast::AttrsOwner for ParenExpr {} | 786 | impl ast::AttrsOwner for ParenExpr {} |
787 | impl ParenExpr { | 787 | impl ParenExpr { |
788 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 788 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
789 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 789 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
790 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 790 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
791 | } | 791 | } |
792 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 792 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
793 | pub struct PathExpr { | 793 | pub struct PathExpr { |
@@ -1095,8 +1095,8 @@ impl AstNode for IndexExpr { | |||
1095 | } | 1095 | } |
1096 | impl ast::AttrsOwner for IndexExpr {} | 1096 | impl ast::AttrsOwner for IndexExpr {} |
1097 | impl IndexExpr { | 1097 | impl IndexExpr { |
1098 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1098 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) } |
1099 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1099 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) } |
1100 | } | 1100 | } |
1101 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1101 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1102 | pub struct FieldExpr { | 1102 | pub struct FieldExpr { |
@@ -1478,9 +1478,9 @@ impl AstNode for ParenPat { | |||
1478 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1478 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1479 | } | 1479 | } |
1480 | impl ParenPat { | 1480 | impl ParenPat { |
1481 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1481 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
1482 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1482 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1483 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1483 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
1484 | } | 1484 | } |
1485 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1485 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1486 | pub struct RefPat { | 1486 | pub struct RefPat { |
@@ -1614,9 +1614,9 @@ impl AstNode for SlicePat { | |||
1614 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1614 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1615 | } | 1615 | } |
1616 | impl SlicePat { | 1616 | impl SlicePat { |
1617 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1617 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) } |
1618 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1618 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1619 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1619 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) } |
1620 | } | 1620 | } |
1621 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1621 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1622 | pub struct RangePat { | 1622 | pub struct RangePat { |
@@ -1756,9 +1756,9 @@ impl AstNode for TupleStructPat { | |||
1756 | } | 1756 | } |
1757 | impl TupleStructPat { | 1757 | impl TupleStructPat { |
1758 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1758 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1759 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1759 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
1760 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1760 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1761 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1761 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
1762 | } | 1762 | } |
1763 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1763 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1764 | pub struct TuplePat { | 1764 | pub struct TuplePat { |
@@ -1776,9 +1776,9 @@ impl AstNode for TuplePat { | |||
1776 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1776 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1777 | } | 1777 | } |
1778 | impl TuplePat { | 1778 | impl TuplePat { |
1779 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1779 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
1780 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1780 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1781 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1781 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
1782 | } | 1782 | } |
1783 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1783 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1784 | pub struct Visibility { | 1784 | pub struct Visibility { |
@@ -1879,11 +1879,11 @@ impl AstNode for Attr { | |||
1879 | impl Attr { | 1879 | impl Attr { |
1880 | pub fn pound_token(&self) -> Option<Pound> { support::token(&self.syntax) } | 1880 | pub fn pound_token(&self) -> Option<Pound> { support::token(&self.syntax) } |
1881 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 1881 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } |
1882 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1882 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['[']) } |
1883 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1883 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1884 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 1884 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } |
1885 | pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) } | 1885 | pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) } |
1886 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1886 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![']']) } |
1887 | } | 1887 | } |
1888 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1888 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1889 | pub struct TokenTree { | 1889 | pub struct TokenTree { |
@@ -2186,10 +2186,10 @@ impl AstNode for ParamList { | |||
2186 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2186 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2187 | } | 2187 | } |
2188 | impl ParamList { | 2188 | impl ParamList { |
2189 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 2189 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
2190 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } | 2190 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } |
2191 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } | 2191 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } |
2192 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 2192 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
2193 | } | 2193 | } |
2194 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2194 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2195 | pub struct SelfParam { | 2195 | pub struct SelfParam { |
@@ -2354,9 +2354,9 @@ impl AstNode for ArgList { | |||
2354 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2354 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2355 | } | 2355 | } |
2356 | impl ArgList { | 2356 | impl ArgList { |
2357 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 2357 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T!['(']) } |
2358 | pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 2358 | pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
2359 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 2359 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![')']) } |
2360 | } | 2360 | } |
2361 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2361 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2362 | pub struct Path { | 2362 | pub struct Path { |
diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 1483dc08e..943c91e23 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs | |||
@@ -338,7 +338,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
338 | struct RecordFieldDefList { T!['{'], fields: [RecordFieldDef], T!['}'] } | 338 | struct RecordFieldDefList { T!['{'], fields: [RecordFieldDef], T!['}'] } |
339 | struct RecordFieldDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { } | 339 | struct RecordFieldDef: VisibilityOwner, NameOwner, AttrsOwner, DocCommentsOwner, TypeAscriptionOwner { } |
340 | 340 | ||
341 | struct TupleFieldDefList { LParen, fields: [TupleFieldDef], RParen } | 341 | struct TupleFieldDefList { T!['('], fields: [TupleFieldDef], T![')'] } |
342 | struct TupleFieldDef: VisibilityOwner, AttrsOwner { | 342 | struct TupleFieldDef: VisibilityOwner, AttrsOwner { |
343 | TypeRef, | 343 | TypeRef, |
344 | } | 344 | } |
@@ -411,13 +411,13 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
411 | ItemList, | 411 | ItemList, |
412 | } | 412 | } |
413 | 413 | ||
414 | struct ParenType { LParen, TypeRef, RParen } | 414 | struct ParenType { T!['('], TypeRef, T![')'] } |
415 | struct TupleType { LParen, fields: [TypeRef], RParen } | 415 | struct TupleType { T!['('], fields: [TypeRef], T![')'] } |
416 | struct NeverType { Excl } | 416 | struct NeverType { Excl } |
417 | struct PathType { Path } | 417 | struct PathType { Path } |
418 | struct PointerType { Star, T![const], T![mut], TypeRef } | 418 | struct PointerType { Star, T![const], T![mut], TypeRef } |
419 | struct ArrayType { LBrack, TypeRef, T![;], Expr, RBrack } | 419 | struct ArrayType { T!['['], TypeRef, T![;], Expr, T![']'] } |
420 | struct SliceType { LBrack, TypeRef, RBrack } | 420 | struct SliceType { T!['['], TypeRef, T![']'] } |
421 | struct ReferenceType { Amp, Lifetime, T![mut], TypeRef } | 421 | struct ReferenceType { Amp, Lifetime, T![mut], TypeRef } |
422 | struct PlaceholderType { Underscore } | 422 | struct PlaceholderType { Underscore } |
423 | struct FnPointerType { Abi, T![unsafe], T![fn], ParamList, RetType } | 423 | struct FnPointerType { Abi, T![unsafe], T![fn], ParamList, RetType } |
@@ -425,9 +425,9 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
425 | struct ImplTraitType: TypeBoundsOwner { T![impl] } | 425 | struct ImplTraitType: TypeBoundsOwner { T![impl] } |
426 | struct DynTraitType: TypeBoundsOwner { T![dyn] } | 426 | struct DynTraitType: TypeBoundsOwner { T![dyn] } |
427 | 427 | ||
428 | struct TupleExpr: AttrsOwner { LParen, exprs: [Expr], RParen } | 428 | struct TupleExpr: AttrsOwner { T!['('], exprs: [Expr], T![')'] } |
429 | struct ArrayExpr: AttrsOwner { LBrack, exprs: [Expr], T![;], RBrack } | 429 | struct ArrayExpr: AttrsOwner { T!['['], exprs: [Expr], T![;], T![']'] } |
430 | struct ParenExpr: AttrsOwner { LParen, Expr, RParen } | 430 | struct ParenExpr: AttrsOwner { T!['('], Expr, T![')'] } |
431 | struct PathExpr { Path } | 431 | struct PathExpr { Path } |
432 | struct LambdaExpr: AttrsOwner { | 432 | struct LambdaExpr: AttrsOwner { |
433 | T![static], | 433 | T![static], |
@@ -456,7 +456,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
456 | struct MethodCallExpr: AttrsOwner, ArgListOwner { | 456 | struct MethodCallExpr: AttrsOwner, ArgListOwner { |
457 | Expr, Dot, NameRef, TypeArgList, | 457 | Expr, Dot, NameRef, TypeArgList, |
458 | } | 458 | } |
459 | struct IndexExpr: AttrsOwner { LBrack, RBrack } | 459 | struct IndexExpr: AttrsOwner { T!['['], T![']'] } |
460 | struct FieldExpr: AttrsOwner { Expr, Dot, NameRef } | 460 | struct FieldExpr: AttrsOwner { Expr, Dot, NameRef } |
461 | struct AwaitExpr: AttrsOwner { Expr, Dot, T![await] } | 461 | struct AwaitExpr: AttrsOwner { Expr, Dot, T![await] } |
462 | struct TryExpr: AttrsOwner { T![try], Expr } | 462 | struct TryExpr: AttrsOwner { T![try], Expr } |
@@ -489,14 +489,14 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
489 | struct RecordField: AttrsOwner { NameRef, Colon, Expr } | 489 | struct RecordField: AttrsOwner { NameRef, Colon, Expr } |
490 | 490 | ||
491 | struct OrPat { pats: [Pat] } | 491 | struct OrPat { pats: [Pat] } |
492 | struct ParenPat { LParen, Pat, RParen } | 492 | struct ParenPat { T!['('], Pat, T![')'] } |
493 | struct RefPat { Amp, T![mut], Pat } | 493 | struct RefPat { Amp, T![mut], Pat } |
494 | struct BoxPat { T![box], Pat } | 494 | struct BoxPat { T![box], Pat } |
495 | struct BindPat: AttrsOwner, NameOwner { T![ref], T![mut], At, Pat } | 495 | struct BindPat: AttrsOwner, NameOwner { T![ref], T![mut], At, Pat } |
496 | struct PlaceholderPat { Underscore } | 496 | struct PlaceholderPat { Underscore } |
497 | struct DotDotPat { Dotdot } | 497 | struct DotDotPat { Dotdot } |
498 | struct PathPat { Path } | 498 | struct PathPat { Path } |
499 | struct SlicePat { LBrack, args: [Pat], RBrack } | 499 | struct SlicePat { T!['['], args: [Pat], T![']'] } |
500 | struct RangePat { RangeSeparator } | 500 | struct RangePat { RangeSeparator } |
501 | struct LiteralPat { Literal } | 501 | struct LiteralPat { Literal } |
502 | struct MacroPat { MacroCall } | 502 | struct MacroPat { MacroCall } |
@@ -512,8 +512,8 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
512 | } | 512 | } |
513 | struct RecordFieldPat: AttrsOwner, NameOwner { Colon, Pat } | 513 | struct RecordFieldPat: AttrsOwner, NameOwner { Colon, Pat } |
514 | 514 | ||
515 | struct TupleStructPat { Path, LParen, args: [Pat], RParen } | 515 | struct TupleStructPat { Path, T!['('], args: [Pat], T![')'] } |
516 | struct TuplePat { LParen, args: [Pat], RParen } | 516 | struct TuplePat { T!['('], args: [Pat], T![')'] } |
517 | 517 | ||
518 | struct Visibility { T![pub], T![super], T![self], T![crate] } | 518 | struct Visibility { T![pub], T![super], T![self], T![crate] } |
519 | struct Name { Ident } | 519 | struct Name { Ident } |
@@ -522,7 +522,7 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
522 | struct MacroCall: NameOwner, AttrsOwner,DocCommentsOwner { | 522 | struct MacroCall: NameOwner, AttrsOwner,DocCommentsOwner { |
523 | Path, Excl, TokenTree, T![;] | 523 | Path, Excl, TokenTree, T![;] |
524 | } | 524 | } |
525 | struct Attr { Pound, Excl, LBrack, Path, Eq, input: AttrInput, RBrack } | 525 | struct Attr { Pound, Excl, T!['['], Path, Eq, input: AttrInput, T![']'] } |
526 | struct TokenTree {} | 526 | struct TokenTree {} |
527 | struct TypeParamList { | 527 | struct TypeParamList { |
528 | LAngle, | 528 | LAngle, |
@@ -562,10 +562,10 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
562 | T!['}'], | 562 | T!['}'], |
563 | } | 563 | } |
564 | struct ParamList { | 564 | struct ParamList { |
565 | LParen, | 565 | T!['('], |
566 | SelfParam, | 566 | SelfParam, |
567 | params: [Param], | 567 | params: [Param], |
568 | RParen | 568 | T![')'] |
569 | } | 569 | } |
570 | struct SelfParam: TypeAscriptionOwner, AttrsOwner { Amp, Lifetime, T![self] } | 570 | struct SelfParam: TypeAscriptionOwner, AttrsOwner { Amp, Lifetime, T![self] } |
571 | struct Param: TypeAscriptionOwner, AttrsOwner { | 571 | struct Param: TypeAscriptionOwner, AttrsOwner { |
@@ -585,9 +585,9 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { | |||
585 | T![extern], T![crate], NameRef, Alias, | 585 | T![extern], T![crate], NameRef, Alias, |
586 | } | 586 | } |
587 | struct ArgList { | 587 | struct ArgList { |
588 | LParen, | 588 | T!['('], |
589 | args: [Expr], | 589 | args: [Expr], |
590 | RParen | 590 | T![')'] |
591 | } | 591 | } |
592 | struct Path { | 592 | struct Path { |
593 | segment: PathSegment, | 593 | segment: PathSegment, |
diff --git a/xtask/src/codegen/gen_syntax.rs b/xtask/src/codegen/gen_syntax.rs index b7698ee6e..a903d1da7 100644 --- a/xtask/src/codegen/gen_syntax.rs +++ b/xtask/src/codegen/gen_syntax.rs | |||
@@ -531,6 +531,10 @@ impl Field<'_> { | |||
531 | "->" => "thin_arrow", | 531 | "->" => "thin_arrow", |
532 | "'{'" => "l_curly", | 532 | "'{'" => "l_curly", |
533 | "'}'" => "r_curly", | 533 | "'}'" => "r_curly", |
534 | "'('" => "l_paren", | ||
535 | "')'" => "r_paren", | ||
536 | "'['" => "l_brack", | ||
537 | "']'" => "r_brack", | ||
534 | _ => name, | 538 | _ => name, |
535 | }; | 539 | }; |
536 | format_ident!("{}_token", name) | 540 | format_ident!("{}_token", name) |