-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
nodes.rs
4867 lines (4713 loc) · 160 KB
/
nodes.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//! Generated by `sourcegen_ast`, do not edit by hand.
#![allow(non_snake_case)]
use crate::{
ast::{self, support, AstChildren, AstNode},
SyntaxKind::{self, *},
SyntaxNode, SyntaxToken, T,
};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Name {
pub(crate) syntax: SyntaxNode,
}
impl Name {
pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct NameRef {
pub(crate) syntax: SyntaxNode,
}
impl NameRef {
pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) }
pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) }
pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) }
pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
pub fn Self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![Self]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Lifetime {
pub(crate) syntax: SyntaxNode,
}
impl Lifetime {
pub fn lifetime_ident_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![lifetime_ident])
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Path {
pub(crate) syntax: SyntaxNode,
}
impl Path {
pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PathSegment {
pub(crate) syntax: SyntaxNode,
}
impl PathSegment {
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) }
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) }
pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct GenericArgList {
pub(crate) syntax: SyntaxNode,
}
impl GenericArgList {
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) }
pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParamList {
pub(crate) syntax: SyntaxNode,
}
impl ParamList {
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) }
pub fn comma_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![,]) }
pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
pub fn pipe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![|]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RetType {
pub(crate) syntax: SyntaxNode,
}
impl RetType {
pub fn thin_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![->]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PathType {
pub(crate) syntax: SyntaxNode,
}
impl PathType {
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeArg {
pub(crate) syntax: SyntaxNode,
}
impl TypeArg {
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AssocTypeArg {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasTypeBounds for AssocTypeArg {}
impl AssocTypeArg {
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
pub fn const_arg(&self) -> Option<ConstArg> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LifetimeArg {
pub(crate) syntax: SyntaxNode,
}
impl LifetimeArg {
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ConstArg {
pub(crate) syntax: SyntaxNode,
}
impl ConstArg {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeBoundList {
pub(crate) syntax: SyntaxNode,
}
impl TypeBoundList {
pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroCall {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MacroCall {}
impl ast::HasDocComments for MacroCall {}
impl MacroCall {
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Attr {
pub(crate) syntax: SyntaxNode,
}
impl Attr {
pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) }
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
pub fn meta(&self) -> Option<Meta> { support::child(&self.syntax) }
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TokenTree {
pub(crate) syntax: SyntaxNode,
}
impl TokenTree {
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroItems {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasModuleItem for MacroItems {}
impl MacroItems {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroStmts {
pub(crate) syntax: SyntaxNode,
}
impl MacroStmts {
pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SourceFile {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for SourceFile {}
impl ast::HasModuleItem for SourceFile {}
impl ast::HasDocComments for SourceFile {}
impl SourceFile {
pub fn shebang_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![shebang]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Const {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Const {}
impl ast::HasName for Const {}
impl ast::HasVisibility for Const {}
impl ast::HasDocComments for Const {}
impl Const {
pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Enum {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Enum {}
impl ast::HasName for Enum {}
impl ast::HasVisibility for Enum {}
impl ast::HasGenericParams for Enum {}
impl ast::HasDocComments for Enum {}
impl Enum {
pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) }
pub fn variant_list(&self) -> Option<VariantList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExternBlock {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ExternBlock {}
impl ast::HasDocComments for ExternBlock {}
impl ExternBlock {
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
pub fn extern_item_list(&self) -> Option<ExternItemList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExternCrate {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ExternCrate {}
impl ast::HasVisibility for ExternCrate {}
impl ast::HasDocComments for ExternCrate {}
impl ExternCrate {
pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) }
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Fn {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Fn {}
impl ast::HasName for Fn {}
impl ast::HasVisibility for Fn {}
impl ast::HasGenericParams for Fn {}
impl ast::HasDocComments for Fn {}
impl Fn {
pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) }
pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) }
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Impl {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Impl {}
impl ast::HasVisibility for Impl {}
impl ast::HasGenericParams for Impl {}
impl ast::HasDocComments for Impl {}
impl Impl {
pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) }
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroRules {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MacroRules {}
impl ast::HasName for MacroRules {}
impl ast::HasVisibility for MacroRules {}
impl ast::HasDocComments for MacroRules {}
impl MacroRules {
pub fn macro_rules_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![macro_rules])
}
pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) }
pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroDef {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MacroDef {}
impl ast::HasName for MacroDef {}
impl ast::HasVisibility for MacroDef {}
impl ast::HasDocComments for MacroDef {}
impl MacroDef {
pub fn macro_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![macro]) }
pub fn args(&self) -> Option<TokenTree> { support::child(&self.syntax) }
pub fn body(&self) -> Option<TokenTree> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Module {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Module {}
impl ast::HasName for Module {}
impl ast::HasVisibility for Module {}
impl ast::HasDocComments for Module {}
impl Module {
pub fn mod_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mod]) }
pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Static {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Static {}
impl ast::HasName for Static {}
impl ast::HasVisibility for Static {}
impl ast::HasDocComments for Static {}
impl Static {
pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Struct {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Struct {}
impl ast::HasName for Struct {}
impl ast::HasVisibility for Struct {}
impl ast::HasGenericParams for Struct {}
impl ast::HasDocComments for Struct {}
impl Struct {
pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Trait {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Trait {}
impl ast::HasName for Trait {}
impl ast::HasVisibility for Trait {}
impl ast::HasGenericParams for Trait {}
impl ast::HasTypeBounds for Trait {}
impl ast::HasDocComments for Trait {}
impl Trait {
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) }
pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) }
pub fn assoc_item_list(&self) -> Option<AssocItemList> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeAlias {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TypeAlias {}
impl ast::HasName for TypeAlias {}
impl ast::HasVisibility for TypeAlias {}
impl ast::HasGenericParams for TypeAlias {}
impl ast::HasTypeBounds for TypeAlias {}
impl ast::HasDocComments for TypeAlias {}
impl TypeAlias {
pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Union {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Union {}
impl ast::HasName for Union {}
impl ast::HasVisibility for Union {}
impl ast::HasGenericParams for Union {}
impl ast::HasDocComments for Union {}
impl Union {
pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) }
pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Use {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Use {}
impl ast::HasVisibility for Use {}
impl ast::HasDocComments for Use {}
impl Use {
pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Visibility {
pub(crate) syntax: SyntaxNode,
}
impl Visibility {
pub fn pub_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pub]) }
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ItemList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ItemList {}
impl ast::HasModuleItem for ItemList {}
impl ItemList {
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Rename {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasName for Rename {}
impl Rename {
pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UseTree {
pub(crate) syntax: SyntaxNode,
}
impl UseTree {
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) }
pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) }
pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) }
pub fn rename(&self) -> Option<Rename> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct UseTreeList {
pub(crate) syntax: SyntaxNode,
}
impl UseTreeList {
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) }
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Abi {
pub(crate) syntax: SyntaxNode,
}
impl Abi {
pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct GenericParamList {
pub(crate) syntax: SyntaxNode,
}
impl GenericParamList {
pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) }
pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct WhereClause {
pub(crate) syntax: SyntaxNode,
}
impl WhereClause {
pub fn where_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![where]) }
pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BlockExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for BlockExpr {}
impl BlockExpr {
pub fn label(&self) -> Option<Label> { support::child(&self.syntax) }
pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) }
pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
pub fn stmt_list(&self) -> Option<StmtList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SelfParam {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for SelfParam {}
impl ast::HasName for SelfParam {}
impl SelfParam {
pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) }
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) }
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Param {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Param {}
impl Param {
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordFieldList {
pub(crate) syntax: SyntaxNode,
}
impl RecordFieldList {
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) }
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleFieldList {
pub(crate) syntax: SyntaxNode,
}
impl TupleFieldList {
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
pub fn fields(&self) -> AstChildren<TupleField> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordField {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RecordField {}
impl ast::HasName for RecordField {}
impl ast::HasVisibility for RecordField {}
impl ast::HasDocComments for RecordField {}
impl RecordField {
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TupleField {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TupleField {}
impl ast::HasVisibility for TupleField {}
impl ast::HasDocComments for TupleField {}
impl TupleField {
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct VariantList {
pub(crate) syntax: SyntaxNode,
}
impl VariantList {
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
pub fn variants(&self) -> AstChildren<Variant> { support::children(&self.syntax) }
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Variant {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Variant {}
impl ast::HasName for Variant {}
impl ast::HasVisibility for Variant {}
impl ast::HasDocComments for Variant {}
impl Variant {
pub fn field_list(&self) -> Option<FieldList> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AssocItemList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for AssocItemList {}
impl AssocItemList {
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
pub fn assoc_items(&self) -> AstChildren<AssocItem> { support::children(&self.syntax) }
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExternItemList {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ExternItemList {}
impl ExternItemList {
pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) }
pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) }
pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ConstParam {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ConstParam {}
impl ast::HasName for ConstParam {}
impl ConstParam {
pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LifetimeParam {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for LifetimeParam {}
impl ast::HasTypeBounds for LifetimeParam {}
impl LifetimeParam {
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeParam {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for TypeParam {}
impl ast::HasName for TypeParam {}
impl ast::HasTypeBounds for TypeParam {}
impl TypeParam {
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn default_type(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct WherePred {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasTypeBounds for WherePred {}
impl WherePred {
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Meta {
pub(crate) syntax: SyntaxNode,
}
impl Meta {
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExprStmt {
pub(crate) syntax: SyntaxNode,
}
impl ExprStmt {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LetStmt {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for LetStmt {}
impl LetStmt {
pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) }
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) }
pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn let_else(&self) -> Option<LetElse> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LetElse {
pub(crate) syntax: SyntaxNode,
}
impl LetElse {
pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ArrayExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ArrayExpr {}
impl ArrayExpr {
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct AwaitExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for AwaitExpr {}
impl AwaitExpr {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
pub fn await_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![await]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BinExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for BinExpr {}
impl BinExpr {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BoxExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for BoxExpr {}
impl BoxExpr {
pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BreakExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for BreakExpr {}
impl BreakExpr {
pub fn break_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![break]) }
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CallExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for CallExpr {}
impl ast::HasArgList for CallExpr {}
impl CallExpr {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CastExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for CastExpr {}
impl CastExpr {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) }
pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ClosureExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ClosureExpr {}
impl ClosureExpr {
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) }
pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) }
pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) }
pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) }
pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ContinueExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ContinueExpr {}
impl ContinueExpr {
pub fn continue_token(&self) -> Option<SyntaxToken> {
support::token(&self.syntax, T![continue])
}
pub fn lifetime(&self) -> Option<Lifetime> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FieldExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for FieldExpr {}
impl FieldExpr {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ForExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ForExpr {}
impl ForExpr {
pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) }
pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct IfExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for IfExpr {}
impl IfExpr {
pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) }
pub fn else_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![else]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct IndexExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for IndexExpr {}
impl IndexExpr {
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Literal {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for Literal {}
impl Literal {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct LoopExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for LoopExpr {}
impl ast::HasLoopBody for LoopExpr {}
impl LoopExpr {
pub fn loop_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![loop]) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MacroExpr {
pub(crate) syntax: SyntaxNode,
}
impl MacroExpr {
pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MatchExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MatchExpr {}
impl MatchExpr {
pub fn match_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![match]) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct MethodCallExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for MethodCallExpr {}
impl ast::HasArgList for MethodCallExpr {}
impl MethodCallExpr {
pub fn receiver(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) }
pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) }
pub fn generic_arg_list(&self) -> Option<GenericArgList> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParenExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for ParenExpr {}
impl ParenExpr {
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PathExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for PathExpr {}
impl PathExpr {
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct PrefixExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for PrefixExpr {}
impl PrefixExpr {
pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RangeExpr {
pub(crate) syntax: SyntaxNode,
}
impl ast::HasAttrs for RangeExpr {}
impl RangeExpr {}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RecordExpr {
pub(crate) syntax: SyntaxNode,
}
impl RecordExpr {
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn record_expr_field_list(&self) -> Option<RecordExprFieldList> {
support::child(&self.syntax)
}