aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/generated
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/generated')
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs146
1 files changed, 77 insertions, 69 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 20f663046..3b014e312 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -4,7 +4,7 @@ use super::tokens::*;
4use crate::{ 4use crate::{
5 ast::{self, support, AstChildren, AstNode}, 5 ast::{self, support, AstChildren, AstNode},
6 SyntaxKind::{self, *}, 6 SyntaxKind::{self, *},
7 SyntaxNode, SyntaxToken, 7 SyntaxNode, SyntaxToken, T,
8}; 8};
9#[derive(Debug, Clone, PartialEq, Eq, Hash)] 9#[derive(Debug, Clone, PartialEq, Eq, Hash)]
10pub struct SourceFile { 10pub struct SourceFile {
@@ -48,11 +48,13 @@ impl ast::DocCommentsOwner for FnDef {}
48impl ast::AttrsOwner for FnDef {} 48impl ast::AttrsOwner for FnDef {}
49impl FnDef { 49impl FnDef {
50 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } 50 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
51 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, CONST_KW) } 51 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![const]) }
52 pub fn default_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, DEFAULT_KW) } 52 pub fn default_token(&self) -> Option<SyntaxToken> {
53 pub fn async_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, ASYNC_KW) } 53 support::token2(&self.syntax, T![default])
54 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, UNSAFE_KW) } 54 }
55 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, FN_KW) } 55 pub fn async_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![async]) }
56 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![unsafe]) }
57 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![fn]) }
56 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } 58 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
57 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } 59 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
58 pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } 60 pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
@@ -98,7 +100,7 @@ impl ast::TypeParamsOwner for StructDef {}
98impl ast::AttrsOwner for StructDef {} 100impl ast::AttrsOwner for StructDef {}
99impl ast::DocCommentsOwner for StructDef {} 101impl ast::DocCommentsOwner for StructDef {}
100impl StructDef { 102impl StructDef {
101 pub fn struct_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, STRUCT_KW) } 103 pub fn struct_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![struct]) }
102 pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } 104 pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) }
103 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } 105 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
104} 106}
@@ -123,7 +125,7 @@ impl ast::TypeParamsOwner for UnionDef {}
123impl ast::AttrsOwner for UnionDef {} 125impl ast::AttrsOwner for UnionDef {}
124impl ast::DocCommentsOwner for UnionDef {} 126impl ast::DocCommentsOwner for UnionDef {}
125impl UnionDef { 127impl UnionDef {
126 pub fn union_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, UNION_KW) } 128 pub fn union_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![union]) }
127 pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> { 129 pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> {
128 support::child(&self.syntax) 130 support::child(&self.syntax)
129 } 131 }
@@ -230,7 +232,7 @@ impl ast::TypeParamsOwner for EnumDef {}
230impl ast::AttrsOwner for EnumDef {} 232impl ast::AttrsOwner for EnumDef {}
231impl ast::DocCommentsOwner for EnumDef {} 233impl ast::DocCommentsOwner for EnumDef {}
232impl EnumDef { 234impl EnumDef {
233 pub fn enum_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, ENUM_KW) } 235 pub fn enum_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![enum]) }
234 pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } 236 pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) }
235} 237}
236#[derive(Debug, Clone, PartialEq, Eq, Hash)] 238#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -299,9 +301,9 @@ impl ast::DocCommentsOwner for TraitDef {}
299impl ast::TypeParamsOwner for TraitDef {} 301impl ast::TypeParamsOwner for TraitDef {}
300impl ast::TypeBoundsOwner for TraitDef {} 302impl ast::TypeBoundsOwner for TraitDef {}
301impl TraitDef { 303impl TraitDef {
302 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, UNSAFE_KW) } 304 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![unsafe]) }
303 pub fn auto_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, AUTO_KW) } 305 pub fn auto_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![auto]) }
304 pub fn trait_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, TRAIT_KW) } 306 pub fn trait_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![trait]) }
305 pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } 307 pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
306} 308}
307#[derive(Debug, Clone, PartialEq, Eq, Hash)] 309#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -324,7 +326,7 @@ impl ast::NameOwner for Module {}
324impl ast::AttrsOwner for Module {} 326impl ast::AttrsOwner for Module {}
325impl ast::DocCommentsOwner for Module {} 327impl ast::DocCommentsOwner for Module {}
326impl Module { 328impl Module {
327 pub fn mod_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MOD_KW) } 329 pub fn mod_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![mod]) }
328 pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } 330 pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
329 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } 331 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
330} 332}
@@ -371,8 +373,10 @@ impl ast::AttrsOwner for ConstDef {}
371impl ast::DocCommentsOwner for ConstDef {} 373impl ast::DocCommentsOwner for ConstDef {}
372impl ast::TypeAscriptionOwner for ConstDef {} 374impl ast::TypeAscriptionOwner for ConstDef {}
373impl ConstDef { 375impl ConstDef {
374 pub fn default_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, DEFAULT_KW) } 376 pub fn default_token(&self) -> Option<SyntaxToken> {
375 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, CONST_KW) } 377 support::token2(&self.syntax, T![default])
378 }
379 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![const]) }
376 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } 380 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
377 pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } 381 pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
378 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } 382 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
@@ -399,8 +403,8 @@ impl ast::AttrsOwner for StaticDef {}
399impl ast::DocCommentsOwner for StaticDef {} 403impl ast::DocCommentsOwner for StaticDef {}
400impl ast::TypeAscriptionOwner for StaticDef {} 404impl ast::TypeAscriptionOwner for StaticDef {}
401impl StaticDef { 405impl StaticDef {
402 pub fn static_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, STATIC_KW) } 406 pub fn static_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![static]) }
403 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MUT_KW) } 407 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![mut]) }
404 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } 408 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
405 pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } 409 pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
406 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } 410 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
@@ -427,8 +431,10 @@ impl ast::AttrsOwner for TypeAliasDef {}
427impl ast::DocCommentsOwner for TypeAliasDef {} 431impl ast::DocCommentsOwner for TypeAliasDef {}
428impl ast::TypeBoundsOwner for TypeAliasDef {} 432impl ast::TypeBoundsOwner for TypeAliasDef {}
429impl TypeAliasDef { 433impl TypeAliasDef {
430 pub fn default_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, DEFAULT_KW) } 434 pub fn default_token(&self) -> Option<SyntaxToken> {
431 pub fn type_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, TYPE_KW) } 435 support::token2(&self.syntax, T![default])
436 }
437 pub fn type_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![type]) }
432 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } 438 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
433 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } 439 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
434 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } 440 pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) }
@@ -451,12 +457,14 @@ impl AstNode for ImplDef {
451impl ast::TypeParamsOwner for ImplDef {} 457impl ast::TypeParamsOwner for ImplDef {}
452impl ast::AttrsOwner for ImplDef {} 458impl ast::AttrsOwner for ImplDef {}
453impl ImplDef { 459impl ImplDef {
454 pub fn default_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, DEFAULT_KW) } 460 pub fn default_token(&self) -> Option<SyntaxToken> {
455 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, CONST_KW) } 461 support::token2(&self.syntax, T![default])
456 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, UNSAFE_KW) } 462 }
457 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, IMPL_KW) } 463 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![const]) }
464 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![unsafe]) }
465 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![impl]) }
458 pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } 466 pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) }
459 pub fn for_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, FOR_KW) } 467 pub fn for_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![for]) }
460 pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } 468 pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
461} 469}
462#[derive(Debug, Clone, PartialEq, Eq, Hash)] 470#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -552,8 +560,8 @@ impl AstNode for PointerType {
552} 560}
553impl PointerType { 561impl PointerType {
554 pub fn star_token(&self) -> Option<Star> { support::token(&self.syntax) } 562 pub fn star_token(&self) -> Option<Star> { support::token(&self.syntax) }
555 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, CONST_KW) } 563 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![const]) }
556 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MUT_KW) } 564 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![mut]) }
557 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } 565 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
558} 566}
559#[derive(Debug, Clone, PartialEq, Eq, Hash)] 567#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -616,7 +624,7 @@ impl AstNode for ReferenceType {
616impl ReferenceType { 624impl ReferenceType {
617 pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } 625 pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) }
618 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } 626 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
619 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MUT_KW) } 627 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![mut]) }
620 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } 628 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
621} 629}
622#[derive(Debug, Clone, PartialEq, Eq, Hash)] 630#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -654,8 +662,8 @@ impl AstNode for FnPointerType {
654} 662}
655impl FnPointerType { 663impl FnPointerType {
656 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } 664 pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
657 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, UNSAFE_KW) } 665 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![unsafe]) }
658 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, FN_KW) } 666 pub fn fn_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![fn]) }
659 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } 667 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
660 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } 668 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
661} 669}
@@ -675,7 +683,7 @@ impl AstNode for ForType {
675 fn syntax(&self) -> &SyntaxNode { &self.syntax } 683 fn syntax(&self) -> &SyntaxNode { &self.syntax }
676} 684}
677impl ForType { 685impl ForType {
678 pub fn for_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, FOR_KW) } 686 pub fn for_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![for]) }
679 pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } 687 pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) }
680 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } 688 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
681} 689}
@@ -696,7 +704,7 @@ impl AstNode for ImplTraitType {
696} 704}
697impl ast::TypeBoundsOwner for ImplTraitType {} 705impl ast::TypeBoundsOwner for ImplTraitType {}
698impl ImplTraitType { 706impl ImplTraitType {
699 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, IMPL_KW) } 707 pub fn impl_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![impl]) }
700} 708}
701#[derive(Debug, Clone, PartialEq, Eq, Hash)] 709#[derive(Debug, Clone, PartialEq, Eq, Hash)]
702pub struct DynTraitType { 710pub struct DynTraitType {
@@ -715,7 +723,7 @@ impl AstNode for DynTraitType {
715} 723}
716impl ast::TypeBoundsOwner for DynTraitType {} 724impl ast::TypeBoundsOwner for DynTraitType {}
717impl DynTraitType { 725impl DynTraitType {
718 pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, DYN_KW) } 726 pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![dyn]) }
719} 727}
720#[derive(Debug, Clone, PartialEq, Eq, Hash)] 728#[derive(Debug, Clone, PartialEq, Eq, Hash)]
721pub struct TupleExpr { 729pub struct TupleExpr {
@@ -816,9 +824,9 @@ impl AstNode for LambdaExpr {
816} 824}
817impl ast::AttrsOwner for LambdaExpr {} 825impl ast::AttrsOwner for LambdaExpr {}
818impl LambdaExpr { 826impl LambdaExpr {
819 pub fn static_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, STATIC_KW) } 827 pub fn static_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![static]) }
820 pub fn async_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, ASYNC_KW) } 828 pub fn async_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![async]) }
821 pub fn move_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MOVE_KW) } 829 pub fn move_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![move]) }
822 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } 830 pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
823 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } 831 pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
824 pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } 832 pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
@@ -840,7 +848,7 @@ impl AstNode for IfExpr {
840} 848}
841impl ast::AttrsOwner for IfExpr {} 849impl ast::AttrsOwner for IfExpr {}
842impl IfExpr { 850impl IfExpr {
843 pub fn if_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, IF_KW) } 851 pub fn if_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![if]) }
844 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } 852 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) }
845} 853}
846#[derive(Debug, Clone, PartialEq, Eq, Hash)] 854#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -861,7 +869,7 @@ impl AstNode for LoopExpr {
861impl ast::AttrsOwner for LoopExpr {} 869impl ast::AttrsOwner for LoopExpr {}
862impl ast::LoopBodyOwner for LoopExpr {} 870impl ast::LoopBodyOwner for LoopExpr {}
863impl LoopExpr { 871impl LoopExpr {
864 pub fn loop_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, LOOP_KW) } 872 pub fn loop_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![loop]) }
865} 873}
866#[derive(Debug, Clone, PartialEq, Eq, Hash)] 874#[derive(Debug, Clone, PartialEq, Eq, Hash)]
867pub struct TryBlockExpr { 875pub struct TryBlockExpr {
@@ -880,7 +888,7 @@ impl AstNode for TryBlockExpr {
880} 888}
881impl ast::AttrsOwner for TryBlockExpr {} 889impl ast::AttrsOwner for TryBlockExpr {}
882impl TryBlockExpr { 890impl TryBlockExpr {
883 pub fn try_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, TRY_KW) } 891 pub fn try_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![try]) }
884 pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } 892 pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
885} 893}
886#[derive(Debug, Clone, PartialEq, Eq, Hash)] 894#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -901,9 +909,9 @@ impl AstNode for ForExpr {
901impl ast::AttrsOwner for ForExpr {} 909impl ast::AttrsOwner for ForExpr {}
902impl ast::LoopBodyOwner for ForExpr {} 910impl ast::LoopBodyOwner for ForExpr {}
903impl ForExpr { 911impl ForExpr {
904 pub fn for_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, FOR_KW) } 912 pub fn for_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![for]) }
905 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 913 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
906 pub fn in_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, IN_KW) } 914 pub fn in_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![in]) }
907 pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) } 915 pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) }
908} 916}
909#[derive(Debug, Clone, PartialEq, Eq, Hash)] 917#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -924,7 +932,7 @@ impl AstNode for WhileExpr {
924impl ast::AttrsOwner for WhileExpr {} 932impl ast::AttrsOwner for WhileExpr {}
925impl ast::LoopBodyOwner for WhileExpr {} 933impl ast::LoopBodyOwner for WhileExpr {}
926impl WhileExpr { 934impl WhileExpr {
927 pub fn while_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, WHILE_KW) } 935 pub fn while_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![while]) }
928 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } 936 pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) }
929} 937}
930#[derive(Debug, Clone, PartialEq, Eq, Hash)] 938#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -945,7 +953,7 @@ impl AstNode for ContinueExpr {
945impl ast::AttrsOwner for ContinueExpr {} 953impl ast::AttrsOwner for ContinueExpr {}
946impl ContinueExpr { 954impl ContinueExpr {
947 pub fn continue_token(&self) -> Option<SyntaxToken> { 955 pub fn continue_token(&self) -> Option<SyntaxToken> {
948 support::token2(&self.syntax, CONTINUE_KW) 956 support::token2(&self.syntax, T![continue])
949 } 957 }
950 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } 958 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
951} 959}
@@ -966,7 +974,7 @@ impl AstNode for BreakExpr {
966} 974}
967impl ast::AttrsOwner for BreakExpr {} 975impl ast::AttrsOwner for BreakExpr {}
968impl BreakExpr { 976impl BreakExpr {
969 pub fn break_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, BREAK_KW) } 977 pub fn break_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![break]) }
970 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } 978 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
971 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 979 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
972} 980}
@@ -1006,7 +1014,7 @@ impl AstNode for BlockExpr {
1006impl ast::AttrsOwner for BlockExpr {} 1014impl ast::AttrsOwner for BlockExpr {}
1007impl BlockExpr { 1015impl BlockExpr {
1008 pub fn label(&self) -> Option<Label> { support::child(&self.syntax) } 1016 pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
1009 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, UNSAFE_KW) } 1017 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![unsafe]) }
1010 pub fn block(&self) -> Option<Block> { support::child(&self.syntax) } 1018 pub fn block(&self) -> Option<Block> { support::child(&self.syntax) }
1011} 1019}
1012#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1020#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1130,7 +1138,7 @@ impl ast::AttrsOwner for AwaitExpr {}
1130impl AwaitExpr { 1138impl AwaitExpr {
1131 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1139 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1132 pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) } 1140 pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) }
1133 pub fn await_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, AWAIT_KW) } 1141 pub fn await_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![await]) }
1134} 1142}
1135#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1143#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1136pub struct TryExpr { 1144pub struct TryExpr {
@@ -1149,7 +1157,7 @@ impl AstNode for TryExpr {
1149} 1157}
1150impl ast::AttrsOwner for TryExpr {} 1158impl ast::AttrsOwner for TryExpr {}
1151impl TryExpr { 1159impl TryExpr {
1152 pub fn try_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, TRY_KW) } 1160 pub fn try_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![try]) }
1153 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1161 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1154} 1162}
1155#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1163#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1170,7 +1178,7 @@ impl AstNode for CastExpr {
1170impl ast::AttrsOwner for CastExpr {} 1178impl ast::AttrsOwner for CastExpr {}
1171impl CastExpr { 1179impl CastExpr {
1172 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1180 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1173 pub fn as_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, AS_KW) } 1181 pub fn as_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![as]) }
1174 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } 1182 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
1175} 1183}
1176#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1184#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1191,8 +1199,8 @@ impl AstNode for RefExpr {
1191impl ast::AttrsOwner for RefExpr {} 1199impl ast::AttrsOwner for RefExpr {}
1192impl RefExpr { 1200impl RefExpr {
1193 pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } 1201 pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) }
1194 pub fn raw_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, RAW_KW) } 1202 pub fn raw_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![raw]) }
1195 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MUT_KW) } 1203 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![mut]) }
1196 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1204 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1197} 1205}
1198#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1206#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1232,7 +1240,7 @@ impl AstNode for BoxExpr {
1232} 1240}
1233impl ast::AttrsOwner for BoxExpr {} 1241impl ast::AttrsOwner for BoxExpr {}
1234impl BoxExpr { 1242impl BoxExpr {
1235 pub fn box_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, BOX_KW) } 1243 pub fn box_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![box]) }
1236 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1244 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1237} 1245}
1238#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1246#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1308,7 +1316,7 @@ impl AstNode for MatchExpr {
1308} 1316}
1309impl ast::AttrsOwner for MatchExpr {} 1317impl ast::AttrsOwner for MatchExpr {}
1310impl MatchExpr { 1318impl MatchExpr {
1311 pub fn match_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MATCH_KW) } 1319 pub fn match_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![match]) }
1312 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1320 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1313 pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) } 1321 pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) }
1314} 1322}
@@ -1371,7 +1379,7 @@ impl AstNode for MatchGuard {
1371 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1379 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1372} 1380}
1373impl MatchGuard { 1381impl MatchGuard {
1374 pub fn if_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, IF_KW) } 1382 pub fn if_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![if]) }
1375 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 1383 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
1376} 1384}
1377#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1385#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1491,7 +1499,7 @@ impl AstNode for RefPat {
1491} 1499}
1492impl RefPat { 1500impl RefPat {
1493 pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } 1501 pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) }
1494 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MUT_KW) } 1502 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![mut]) }
1495 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 1503 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1496} 1504}
1497#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1505#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1510,7 +1518,7 @@ impl AstNode for BoxPat {
1510 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1518 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1511} 1519}
1512impl BoxPat { 1520impl BoxPat {
1513 pub fn box_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, BOX_KW) } 1521 pub fn box_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![box]) }
1514 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 1522 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1515} 1523}
1516#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1524#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1531,8 +1539,8 @@ impl AstNode for BindPat {
1531impl ast::AttrsOwner for BindPat {} 1539impl ast::AttrsOwner for BindPat {}
1532impl ast::NameOwner for BindPat {} 1540impl ast::NameOwner for BindPat {}
1533impl BindPat { 1541impl BindPat {
1534 pub fn ref_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, REF_KW) } 1542 pub fn ref_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![ref]) }
1535 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, MUT_KW) } 1543 pub fn mut_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![mut]) }
1536 pub fn at_token(&self) -> Option<At> { support::token(&self.syntax) } 1544 pub fn at_token(&self) -> Option<At> { support::token(&self.syntax) }
1537 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 1545 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
1538} 1546}
@@ -1788,10 +1796,10 @@ impl AstNode for Visibility {
1788 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1796 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1789} 1797}
1790impl Visibility { 1798impl Visibility {
1791 pub fn pub_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, PUB_KW) } 1799 pub fn pub_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![pub]) }
1792 pub fn super_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, SUPER_KW) } 1800 pub fn super_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![super]) }
1793 pub fn self_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, SELF_KW) } 1801 pub fn self_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![self]) }
1794 pub fn crate_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, CRATE_KW) } 1802 pub fn crate_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![crate]) }
1795} 1803}
1796#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1804#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1797pub struct Name { 1805pub struct Name {
@@ -1996,7 +2004,7 @@ impl AstNode for TypeBound {
1996} 2004}
1997impl TypeBound { 2005impl TypeBound {
1998 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } 2006 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
1999 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, CONST_KW) } 2007 pub fn const_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![const]) }
2000 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } 2008 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
2001} 2009}
2002#[derive(Debug, Clone, PartialEq, Eq, Hash)] 2010#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2053,7 +2061,7 @@ impl AstNode for WhereClause {
2053 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2061 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2054} 2062}
2055impl WhereClause { 2063impl WhereClause {
2056 pub fn where_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, WHERE_KW) } 2064 pub fn where_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![where]) }
2057 pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) } 2065 pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) }
2058} 2066}
2059#[derive(Debug, Clone, PartialEq, Eq, Hash)] 2067#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2112,7 +2120,7 @@ impl AstNode for LetStmt {
2112impl ast::AttrsOwner for LetStmt {} 2120impl ast::AttrsOwner for LetStmt {}
2113impl ast::TypeAscriptionOwner for LetStmt {} 2121impl ast::TypeAscriptionOwner for LetStmt {}
2114impl LetStmt { 2122impl LetStmt {
2115 pub fn let_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, LET_KW) } 2123 pub fn let_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![let]) }
2116 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 2124 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
2117 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } 2125 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
2118 pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) } 2126 pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) }
@@ -2134,7 +2142,7 @@ impl AstNode for Condition {
2134 fn syntax(&self) -> &SyntaxNode { &self.syntax } 2142 fn syntax(&self) -> &SyntaxNode { &self.syntax }
2135} 2143}
2136impl Condition { 2144impl Condition {
2137 pub fn let_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, LET_KW) } 2145 pub fn let_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![let]) }
2138 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } 2146 pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
2139 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } 2147 pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) }
2140 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } 2148 pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
@@ -2203,7 +2211,7 @@ impl ast::AttrsOwner for SelfParam {}
2203impl SelfParam { 2211impl SelfParam {
2204 pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } 2212 pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) }
2205 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } 2213 pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) }
2206 pub fn self_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, SELF_KW) } 2214 pub fn self_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![self]) }
2207} 2215}
2208#[derive(Debug, Clone, PartialEq, Eq, Hash)] 2216#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2209pub struct Param { 2217pub struct Param {
@@ -2244,7 +2252,7 @@ impl AstNode for UseItem {
2244impl ast::AttrsOwner for UseItem {} 2252impl ast::AttrsOwner for UseItem {}
2245impl ast::VisibilityOwner for UseItem {} 2253impl ast::VisibilityOwner for UseItem {}
2246impl UseItem { 2254impl UseItem {
2247 pub fn use_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, USE_KW) } 2255 pub fn use_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![use]) }
2248 pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) } 2256 pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) }
2249} 2257}
2250#[derive(Debug, Clone, PartialEq, Eq, Hash)] 2258#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -2285,7 +2293,7 @@ impl AstNode for Alias {
2285} 2293}
2286impl ast::NameOwner for Alias {} 2294impl ast::NameOwner for Alias {}
2287impl Alias { 2295impl Alias {
2288 pub fn as_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, AS_KW) } 2296 pub fn as_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![as]) }
2289} 2297}
2290#[derive(Debug, Clone, PartialEq, Eq, Hash)] 2298#[derive(Debug, Clone, PartialEq, Eq, Hash)]
2291pub struct UseTreeList { 2299pub struct UseTreeList {
@@ -2325,8 +2333,8 @@ impl AstNode for ExternCrateItem {
2325impl ast::AttrsOwner for ExternCrateItem {} 2333impl ast::AttrsOwner for ExternCrateItem {}
2326impl ast::VisibilityOwner for ExternCrateItem {} 2334impl ast::VisibilityOwner for ExternCrateItem {}
2327impl ExternCrateItem { 2335impl ExternCrateItem {
2328 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, EXTERN_KW) } 2336 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![extern]) }
2329 pub fn crate_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, CRATE_KW) } 2337 pub fn crate_token(&self) -> Option<SyntaxToken> { support::token2(&self.syntax, T![crate]) }
2330 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } 2338 pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
2331 pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } 2339 pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) }
2332} 2340}