diff options
Diffstat (limited to 'crates/ra_syntax/src/ast/generated/nodes.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 559 |
1 files changed, 350 insertions, 209 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index bcbfd1129..f1098755b 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -1,11 +1,11 @@ | |||
1 | //! Generated file, do not edit by hand, see `xtask/src/codegen` | 1 | //! Generated file, do not edit by hand, see `xtask/src/codegen` |
2 | 2 | ||
3 | use super::tokens::*; | ||
4 | use crate::{ | 3 | use crate::{ |
5 | ast::{self, support, AstChildren, AstNode}, | 4 | ast::{self, support, AstChildren, AstNode}, |
6 | SyntaxKind::{self, *}, | 5 | SyntaxKind::{self, *}, |
7 | SyntaxNode, | 6 | SyntaxNode, SyntaxToken, T, |
8 | }; | 7 | }; |
8 | |||
9 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 9 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
10 | pub struct SourceFile { | 10 | pub struct SourceFile { |
11 | pub(crate) syntax: SyntaxNode, | 11 | pub(crate) syntax: SyntaxNode, |
@@ -22,11 +22,11 @@ impl AstNode for SourceFile { | |||
22 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 22 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
23 | } | 23 | } |
24 | impl ast::ModuleItemOwner for SourceFile {} | 24 | impl ast::ModuleItemOwner for SourceFile {} |
25 | impl ast::FnDefOwner for SourceFile {} | ||
26 | impl ast::AttrsOwner for SourceFile {} | 25 | impl ast::AttrsOwner for SourceFile {} |
27 | impl SourceFile { | 26 | impl SourceFile { |
28 | pub fn modules(&self) -> AstChildren<Module> { support::children(&self.syntax) } | 27 | pub fn modules(&self) -> AstChildren<Module> { support::children(&self.syntax) } |
29 | } | 28 | } |
29 | |||
30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 30 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
31 | pub struct FnDef { | 31 | pub struct FnDef { |
32 | pub(crate) syntax: SyntaxNode, | 32 | pub(crate) syntax: SyntaxNode, |
@@ -49,16 +49,17 @@ impl ast::DocCommentsOwner for FnDef {} | |||
49 | impl ast::AttrsOwner for FnDef {} | 49 | impl ast::AttrsOwner for FnDef {} |
50 | impl FnDef { | 50 | impl FnDef { |
51 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | 51 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } |
52 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 52 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
53 | pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) } | 53 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
54 | pub fn async_kw_token(&self) -> Option<AsyncKw> { support::token(&self.syntax) } | 54 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } |
55 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 55 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
56 | pub fn fn_kw_token(&self) -> Option<FnKw> { support::token(&self.syntax) } | 56 | pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } |
57 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 57 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
58 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 58 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
59 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } | 59 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } |
60 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 60 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
61 | } | 61 | } |
62 | |||
62 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 63 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
63 | pub struct RetType { | 64 | pub struct RetType { |
64 | pub(crate) syntax: SyntaxNode, | 65 | pub(crate) syntax: SyntaxNode, |
@@ -75,9 +76,10 @@ impl AstNode for RetType { | |||
75 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 76 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
76 | } | 77 | } |
77 | impl RetType { | 78 | impl RetType { |
78 | pub fn thin_arrow_token(&self) -> Option<ThinArrow> { support::token(&self.syntax) } | 79 | pub fn thin_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![->]) } |
79 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 80 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
80 | } | 81 | } |
82 | |||
81 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 83 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
82 | pub struct StructDef { | 84 | pub struct StructDef { |
83 | pub(crate) syntax: SyntaxNode, | 85 | pub(crate) syntax: SyntaxNode, |
@@ -99,10 +101,11 @@ impl ast::TypeParamsOwner for StructDef {} | |||
99 | impl ast::AttrsOwner for StructDef {} | 101 | impl ast::AttrsOwner for StructDef {} |
100 | impl ast::DocCommentsOwner for StructDef {} | 102 | impl ast::DocCommentsOwner for StructDef {} |
101 | impl StructDef { | 103 | impl StructDef { |
102 | pub fn struct_kw_token(&self) -> Option<StructKw> { support::token(&self.syntax) } | 104 | pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) } |
103 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } | 105 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } |
104 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 106 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
105 | } | 107 | } |
108 | |||
106 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 109 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
107 | pub struct UnionDef { | 110 | pub struct UnionDef { |
108 | pub(crate) syntax: SyntaxNode, | 111 | pub(crate) syntax: SyntaxNode, |
@@ -124,11 +127,12 @@ impl ast::TypeParamsOwner for UnionDef {} | |||
124 | impl ast::AttrsOwner for UnionDef {} | 127 | impl ast::AttrsOwner for UnionDef {} |
125 | impl ast::DocCommentsOwner for UnionDef {} | 128 | impl ast::DocCommentsOwner for UnionDef {} |
126 | impl UnionDef { | 129 | impl UnionDef { |
127 | pub fn union_kw_token(&self) -> Option<UnionKw> { support::token(&self.syntax) } | 130 | pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) } |
128 | pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> { | 131 | pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> { |
129 | support::child(&self.syntax) | 132 | support::child(&self.syntax) |
130 | } | 133 | } |
131 | } | 134 | } |
135 | |||
132 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 136 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
133 | pub struct RecordFieldDefList { | 137 | pub struct RecordFieldDefList { |
134 | pub(crate) syntax: SyntaxNode, | 138 | pub(crate) syntax: SyntaxNode, |
@@ -145,10 +149,11 @@ impl AstNode for RecordFieldDefList { | |||
145 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 149 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
146 | } | 150 | } |
147 | impl RecordFieldDefList { | 151 | impl RecordFieldDefList { |
148 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 152 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
149 | pub fn fields(&self) -> AstChildren<RecordFieldDef> { support::children(&self.syntax) } | 153 | pub fn fields(&self) -> AstChildren<RecordFieldDef> { support::children(&self.syntax) } |
150 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 154 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
151 | } | 155 | } |
156 | |||
152 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 157 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
153 | pub struct RecordFieldDef { | 158 | pub struct RecordFieldDef { |
154 | pub(crate) syntax: SyntaxNode, | 159 | pub(crate) syntax: SyntaxNode, |
@@ -170,6 +175,7 @@ impl ast::AttrsOwner for RecordFieldDef {} | |||
170 | impl ast::DocCommentsOwner for RecordFieldDef {} | 175 | impl ast::DocCommentsOwner for RecordFieldDef {} |
171 | impl ast::TypeAscriptionOwner for RecordFieldDef {} | 176 | impl ast::TypeAscriptionOwner for RecordFieldDef {} |
172 | impl RecordFieldDef {} | 177 | impl RecordFieldDef {} |
178 | |||
173 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 179 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
174 | pub struct TupleFieldDefList { | 180 | pub struct TupleFieldDefList { |
175 | pub(crate) syntax: SyntaxNode, | 181 | pub(crate) syntax: SyntaxNode, |
@@ -186,10 +192,11 @@ impl AstNode for TupleFieldDefList { | |||
186 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 192 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
187 | } | 193 | } |
188 | impl TupleFieldDefList { | 194 | impl TupleFieldDefList { |
189 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 195 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
190 | pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) } | 196 | pub fn fields(&self) -> AstChildren<TupleFieldDef> { support::children(&self.syntax) } |
191 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 197 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
192 | } | 198 | } |
199 | |||
193 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 200 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
194 | pub struct TupleFieldDef { | 201 | pub struct TupleFieldDef { |
195 | pub(crate) syntax: SyntaxNode, | 202 | pub(crate) syntax: SyntaxNode, |
@@ -210,6 +217,7 @@ impl ast::AttrsOwner for TupleFieldDef {} | |||
210 | impl TupleFieldDef { | 217 | impl TupleFieldDef { |
211 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 218 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
212 | } | 219 | } |
220 | |||
213 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 221 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
214 | pub struct EnumDef { | 222 | pub struct EnumDef { |
215 | pub(crate) syntax: SyntaxNode, | 223 | pub(crate) syntax: SyntaxNode, |
@@ -231,9 +239,10 @@ impl ast::TypeParamsOwner for EnumDef {} | |||
231 | impl ast::AttrsOwner for EnumDef {} | 239 | impl ast::AttrsOwner for EnumDef {} |
232 | impl ast::DocCommentsOwner for EnumDef {} | 240 | impl ast::DocCommentsOwner for EnumDef {} |
233 | impl EnumDef { | 241 | impl EnumDef { |
234 | pub fn enum_kw_token(&self) -> Option<EnumKw> { support::token(&self.syntax) } | 242 | pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } |
235 | pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } | 243 | pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } |
236 | } | 244 | } |
245 | |||
237 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 246 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
238 | pub struct EnumVariantList { | 247 | pub struct EnumVariantList { |
239 | pub(crate) syntax: SyntaxNode, | 248 | pub(crate) syntax: SyntaxNode, |
@@ -250,10 +259,11 @@ impl AstNode for EnumVariantList { | |||
250 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 259 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
251 | } | 260 | } |
252 | impl EnumVariantList { | 261 | impl EnumVariantList { |
253 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 262 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
254 | pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) } | 263 | pub fn variants(&self) -> AstChildren<EnumVariant> { support::children(&self.syntax) } |
255 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 264 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
256 | } | 265 | } |
266 | |||
257 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 267 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
258 | pub struct EnumVariant { | 268 | pub struct EnumVariant { |
259 | pub(crate) syntax: SyntaxNode, | 269 | pub(crate) syntax: SyntaxNode, |
@@ -275,9 +285,10 @@ impl ast::DocCommentsOwner for EnumVariant {} | |||
275 | impl ast::AttrsOwner for EnumVariant {} | 285 | impl ast::AttrsOwner for EnumVariant {} |
276 | impl EnumVariant { | 286 | impl EnumVariant { |
277 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } | 287 | pub fn field_def_list(&self) -> Option<FieldDefList> { support::child(&self.syntax) } |
278 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 288 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
279 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 289 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
280 | } | 290 | } |
291 | |||
281 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 292 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
282 | pub struct TraitDef { | 293 | pub struct TraitDef { |
283 | pub(crate) syntax: SyntaxNode, | 294 | pub(crate) syntax: SyntaxNode, |
@@ -300,11 +311,12 @@ impl ast::DocCommentsOwner for TraitDef {} | |||
300 | impl ast::TypeParamsOwner for TraitDef {} | 311 | impl ast::TypeParamsOwner for TraitDef {} |
301 | impl ast::TypeBoundsOwner for TraitDef {} | 312 | impl ast::TypeBoundsOwner for TraitDef {} |
302 | impl TraitDef { | 313 | impl TraitDef { |
303 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 314 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
304 | pub fn auto_kw_token(&self) -> Option<AutoKw> { support::token(&self.syntax) } | 315 | pub fn auto_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![auto]) } |
305 | pub fn trait_kw_token(&self) -> Option<TraitKw> { support::token(&self.syntax) } | 316 | pub fn trait_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![trait]) } |
306 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 317 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } |
307 | } | 318 | } |
319 | |||
308 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 320 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
309 | pub struct Module { | 321 | pub struct Module { |
310 | pub(crate) syntax: SyntaxNode, | 322 | pub(crate) syntax: SyntaxNode, |
@@ -325,10 +337,11 @@ impl ast::NameOwner for Module {} | |||
325 | impl ast::AttrsOwner for Module {} | 337 | impl ast::AttrsOwner for Module {} |
326 | impl ast::DocCommentsOwner for Module {} | 338 | impl ast::DocCommentsOwner for Module {} |
327 | impl Module { | 339 | impl Module { |
328 | pub fn mod_kw_token(&self) -> Option<ModKw> { support::token(&self.syntax) } | 340 | pub fn mod_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mod]) } |
329 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 341 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } |
330 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 342 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
331 | } | 343 | } |
344 | |||
332 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 345 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
333 | pub struct ItemList { | 346 | pub struct ItemList { |
334 | pub(crate) syntax: SyntaxNode, | 347 | pub(crate) syntax: SyntaxNode, |
@@ -344,13 +357,13 @@ impl AstNode for ItemList { | |||
344 | } | 357 | } |
345 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 358 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
346 | } | 359 | } |
347 | impl ast::FnDefOwner for ItemList {} | ||
348 | impl ast::ModuleItemOwner for ItemList {} | 360 | impl ast::ModuleItemOwner for ItemList {} |
349 | impl ItemList { | 361 | impl ItemList { |
350 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 362 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
351 | pub fn impl_items(&self) -> AstChildren<ImplItem> { support::children(&self.syntax) } | 363 | pub fn impl_items(&self) -> AstChildren<ImplItem> { support::children(&self.syntax) } |
352 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 364 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
353 | } | 365 | } |
366 | |||
354 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 367 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
355 | pub struct ConstDef { | 368 | pub struct ConstDef { |
356 | pub(crate) syntax: SyntaxNode, | 369 | pub(crate) syntax: SyntaxNode, |
@@ -373,12 +386,13 @@ impl ast::AttrsOwner for ConstDef {} | |||
373 | impl ast::DocCommentsOwner for ConstDef {} | 386 | impl ast::DocCommentsOwner for ConstDef {} |
374 | impl ast::TypeAscriptionOwner for ConstDef {} | 387 | impl ast::TypeAscriptionOwner for ConstDef {} |
375 | impl ConstDef { | 388 | impl ConstDef { |
376 | pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) } | 389 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
377 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 390 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
378 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 391 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
379 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 392 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
380 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 393 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
381 | } | 394 | } |
395 | |||
382 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 396 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
383 | pub struct StaticDef { | 397 | pub struct StaticDef { |
384 | pub(crate) syntax: SyntaxNode, | 398 | pub(crate) syntax: SyntaxNode, |
@@ -401,12 +415,13 @@ impl ast::AttrsOwner for StaticDef {} | |||
401 | impl ast::DocCommentsOwner for StaticDef {} | 415 | impl ast::DocCommentsOwner for StaticDef {} |
402 | impl ast::TypeAscriptionOwner for StaticDef {} | 416 | impl ast::TypeAscriptionOwner for StaticDef {} |
403 | impl StaticDef { | 417 | impl StaticDef { |
404 | pub fn static_kw_token(&self) -> Option<StaticKw> { support::token(&self.syntax) } | 418 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } |
405 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 419 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
406 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 420 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
407 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 421 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
408 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 422 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
409 | } | 423 | } |
424 | |||
410 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 425 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
411 | pub struct TypeAliasDef { | 426 | pub struct TypeAliasDef { |
412 | pub(crate) syntax: SyntaxNode, | 427 | pub(crate) syntax: SyntaxNode, |
@@ -429,12 +444,13 @@ impl ast::AttrsOwner for TypeAliasDef {} | |||
429 | impl ast::DocCommentsOwner for TypeAliasDef {} | 444 | impl ast::DocCommentsOwner for TypeAliasDef {} |
430 | impl ast::TypeBoundsOwner for TypeAliasDef {} | 445 | impl ast::TypeBoundsOwner for TypeAliasDef {} |
431 | impl TypeAliasDef { | 446 | impl TypeAliasDef { |
432 | pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) } | 447 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
433 | pub fn type_kw_token(&self) -> Option<TypeKw> { support::token(&self.syntax) } | 448 | pub fn type_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![type]) } |
434 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 449 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
435 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 450 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
436 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 451 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
437 | } | 452 | } |
453 | |||
438 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 454 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
439 | pub struct ImplDef { | 455 | pub struct ImplDef { |
440 | pub(crate) syntax: SyntaxNode, | 456 | pub(crate) syntax: SyntaxNode, |
@@ -453,14 +469,15 @@ impl AstNode for ImplDef { | |||
453 | impl ast::TypeParamsOwner for ImplDef {} | 469 | impl ast::TypeParamsOwner for ImplDef {} |
454 | impl ast::AttrsOwner for ImplDef {} | 470 | impl ast::AttrsOwner for ImplDef {} |
455 | impl ImplDef { | 471 | impl ImplDef { |
456 | pub fn default_kw_token(&self) -> Option<DefaultKw> { support::token(&self.syntax) } | 472 | pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } |
457 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 473 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
458 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 474 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
459 | pub fn impl_kw_token(&self) -> Option<ImplKw> { support::token(&self.syntax) } | 475 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } |
460 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 476 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
461 | pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) } | 477 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
462 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } | 478 | pub fn item_list(&self) -> Option<ItemList> { support::child(&self.syntax) } |
463 | } | 479 | } |
480 | |||
464 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 481 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
465 | pub struct ParenType { | 482 | pub struct ParenType { |
466 | pub(crate) syntax: SyntaxNode, | 483 | pub(crate) syntax: SyntaxNode, |
@@ -477,10 +494,11 @@ impl AstNode for ParenType { | |||
477 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 494 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
478 | } | 495 | } |
479 | impl ParenType { | 496 | impl ParenType { |
480 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 497 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
481 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 498 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
482 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 499 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
483 | } | 500 | } |
501 | |||
484 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 502 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
485 | pub struct TupleType { | 503 | pub struct TupleType { |
486 | pub(crate) syntax: SyntaxNode, | 504 | pub(crate) syntax: SyntaxNode, |
@@ -497,10 +515,11 @@ impl AstNode for TupleType { | |||
497 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 515 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
498 | } | 516 | } |
499 | impl TupleType { | 517 | impl TupleType { |
500 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 518 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
501 | pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) } | 519 | pub fn fields(&self) -> AstChildren<TypeRef> { support::children(&self.syntax) } |
502 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 520 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
503 | } | 521 | } |
522 | |||
504 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 523 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
505 | pub struct NeverType { | 524 | pub struct NeverType { |
506 | pub(crate) syntax: SyntaxNode, | 525 | pub(crate) syntax: SyntaxNode, |
@@ -517,8 +536,9 @@ impl AstNode for NeverType { | |||
517 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 536 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
518 | } | 537 | } |
519 | impl NeverType { | 538 | impl NeverType { |
520 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 539 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
521 | } | 540 | } |
541 | |||
522 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 542 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
523 | pub struct PathType { | 543 | pub struct PathType { |
524 | pub(crate) syntax: SyntaxNode, | 544 | pub(crate) syntax: SyntaxNode, |
@@ -537,6 +557,7 @@ impl AstNode for PathType { | |||
537 | impl PathType { | 557 | impl PathType { |
538 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 558 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
539 | } | 559 | } |
560 | |||
540 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 561 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
541 | pub struct PointerType { | 562 | pub struct PointerType { |
542 | pub(crate) syntax: SyntaxNode, | 563 | pub(crate) syntax: SyntaxNode, |
@@ -553,11 +574,12 @@ impl AstNode for PointerType { | |||
553 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 574 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
554 | } | 575 | } |
555 | impl PointerType { | 576 | impl PointerType { |
556 | pub fn star_token(&self) -> Option<Star> { support::token(&self.syntax) } | 577 | pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } |
557 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 578 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } |
558 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 579 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
559 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 580 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
560 | } | 581 | } |
582 | |||
561 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 583 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
562 | pub struct ArrayType { | 584 | pub struct ArrayType { |
563 | pub(crate) syntax: SyntaxNode, | 585 | pub(crate) syntax: SyntaxNode, |
@@ -574,12 +596,13 @@ impl AstNode for ArrayType { | |||
574 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 596 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
575 | } | 597 | } |
576 | impl ArrayType { | 598 | impl ArrayType { |
577 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 599 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
578 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 600 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
579 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 601 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
580 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 602 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
581 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 603 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
582 | } | 604 | } |
605 | |||
583 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 606 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
584 | pub struct SliceType { | 607 | pub struct SliceType { |
585 | pub(crate) syntax: SyntaxNode, | 608 | pub(crate) syntax: SyntaxNode, |
@@ -596,10 +619,11 @@ impl AstNode for SliceType { | |||
596 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 619 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
597 | } | 620 | } |
598 | impl SliceType { | 621 | impl SliceType { |
599 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 622 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
600 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 623 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
601 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 624 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
602 | } | 625 | } |
626 | |||
603 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 627 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
604 | pub struct ReferenceType { | 628 | pub struct ReferenceType { |
605 | pub(crate) syntax: SyntaxNode, | 629 | pub(crate) syntax: SyntaxNode, |
@@ -616,11 +640,14 @@ impl AstNode for ReferenceType { | |||
616 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 640 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
617 | } | 641 | } |
618 | impl ReferenceType { | 642 | impl ReferenceType { |
619 | pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } | 643 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
620 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 644 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
621 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 645 | support::token(&self.syntax, T![lifetime]) |
646 | } | ||
647 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } | ||
622 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 648 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
623 | } | 649 | } |
650 | |||
624 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 651 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
625 | pub struct PlaceholderType { | 652 | pub struct PlaceholderType { |
626 | pub(crate) syntax: SyntaxNode, | 653 | pub(crate) syntax: SyntaxNode, |
@@ -637,8 +664,9 @@ impl AstNode for PlaceholderType { | |||
637 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 664 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
638 | } | 665 | } |
639 | impl PlaceholderType { | 666 | impl PlaceholderType { |
640 | pub fn underscore_token(&self) -> Option<Underscore> { support::token(&self.syntax) } | 667 | pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } |
641 | } | 668 | } |
669 | |||
642 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 670 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
643 | pub struct FnPointerType { | 671 | pub struct FnPointerType { |
644 | pub(crate) syntax: SyntaxNode, | 672 | pub(crate) syntax: SyntaxNode, |
@@ -656,11 +684,12 @@ impl AstNode for FnPointerType { | |||
656 | } | 684 | } |
657 | impl FnPointerType { | 685 | impl FnPointerType { |
658 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | 686 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } |
659 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 687 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
660 | pub fn fn_kw_token(&self) -> Option<FnKw> { support::token(&self.syntax) } | 688 | pub fn fn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![fn]) } |
661 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 689 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
662 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 690 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
663 | } | 691 | } |
692 | |||
664 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 693 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
665 | pub struct ForType { | 694 | pub struct ForType { |
666 | pub(crate) syntax: SyntaxNode, | 695 | pub(crate) syntax: SyntaxNode, |
@@ -677,10 +706,11 @@ impl AstNode for ForType { | |||
677 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 706 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
678 | } | 707 | } |
679 | impl ForType { | 708 | impl ForType { |
680 | pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) } | 709 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
681 | pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } | 710 | pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } |
682 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 711 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
683 | } | 712 | } |
713 | |||
684 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 714 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
685 | pub struct ImplTraitType { | 715 | pub struct ImplTraitType { |
686 | pub(crate) syntax: SyntaxNode, | 716 | pub(crate) syntax: SyntaxNode, |
@@ -698,8 +728,9 @@ impl AstNode for ImplTraitType { | |||
698 | } | 728 | } |
699 | impl ast::TypeBoundsOwner for ImplTraitType {} | 729 | impl ast::TypeBoundsOwner for ImplTraitType {} |
700 | impl ImplTraitType { | 730 | impl ImplTraitType { |
701 | pub fn impl_kw_token(&self) -> Option<ImplKw> { support::token(&self.syntax) } | 731 | pub fn impl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![impl]) } |
702 | } | 732 | } |
733 | |||
703 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 734 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
704 | pub struct DynTraitType { | 735 | pub struct DynTraitType { |
705 | pub(crate) syntax: SyntaxNode, | 736 | pub(crate) syntax: SyntaxNode, |
@@ -717,8 +748,9 @@ impl AstNode for DynTraitType { | |||
717 | } | 748 | } |
718 | impl ast::TypeBoundsOwner for DynTraitType {} | 749 | impl ast::TypeBoundsOwner for DynTraitType {} |
719 | impl DynTraitType { | 750 | impl DynTraitType { |
720 | pub fn dyn_kw_token(&self) -> Option<DynKw> { support::token(&self.syntax) } | 751 | pub fn dyn_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![dyn]) } |
721 | } | 752 | } |
753 | |||
722 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 754 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
723 | pub struct TupleExpr { | 755 | pub struct TupleExpr { |
724 | pub(crate) syntax: SyntaxNode, | 756 | pub(crate) syntax: SyntaxNode, |
@@ -736,10 +768,11 @@ impl AstNode for TupleExpr { | |||
736 | } | 768 | } |
737 | impl ast::AttrsOwner for TupleExpr {} | 769 | impl ast::AttrsOwner for TupleExpr {} |
738 | impl TupleExpr { | 770 | impl TupleExpr { |
739 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 771 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
740 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 772 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
741 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 773 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
742 | } | 774 | } |
775 | |||
743 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 776 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
744 | pub struct ArrayExpr { | 777 | pub struct ArrayExpr { |
745 | pub(crate) syntax: SyntaxNode, | 778 | pub(crate) syntax: SyntaxNode, |
@@ -757,11 +790,12 @@ impl AstNode for ArrayExpr { | |||
757 | } | 790 | } |
758 | impl ast::AttrsOwner for ArrayExpr {} | 791 | impl ast::AttrsOwner for ArrayExpr {} |
759 | impl ArrayExpr { | 792 | impl ArrayExpr { |
760 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 793 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
761 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 794 | pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
762 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 795 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
763 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 796 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
764 | } | 797 | } |
798 | |||
765 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 799 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
766 | pub struct ParenExpr { | 800 | pub struct ParenExpr { |
767 | pub(crate) syntax: SyntaxNode, | 801 | pub(crate) syntax: SyntaxNode, |
@@ -779,10 +813,11 @@ impl AstNode for ParenExpr { | |||
779 | } | 813 | } |
780 | impl ast::AttrsOwner for ParenExpr {} | 814 | impl ast::AttrsOwner for ParenExpr {} |
781 | impl ParenExpr { | 815 | impl ParenExpr { |
782 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 816 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
783 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 817 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
784 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 818 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
785 | } | 819 | } |
820 | |||
786 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 821 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
787 | pub struct PathExpr { | 822 | pub struct PathExpr { |
788 | pub(crate) syntax: SyntaxNode, | 823 | pub(crate) syntax: SyntaxNode, |
@@ -801,6 +836,7 @@ impl AstNode for PathExpr { | |||
801 | impl PathExpr { | 836 | impl PathExpr { |
802 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 837 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
803 | } | 838 | } |
839 | |||
804 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 840 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
805 | pub struct LambdaExpr { | 841 | pub struct LambdaExpr { |
806 | pub(crate) syntax: SyntaxNode, | 842 | pub(crate) syntax: SyntaxNode, |
@@ -818,13 +854,14 @@ impl AstNode for LambdaExpr { | |||
818 | } | 854 | } |
819 | impl ast::AttrsOwner for LambdaExpr {} | 855 | impl ast::AttrsOwner for LambdaExpr {} |
820 | impl LambdaExpr { | 856 | impl LambdaExpr { |
821 | pub fn static_kw_token(&self) -> Option<StaticKw> { support::token(&self.syntax) } | 857 | pub fn static_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![static]) } |
822 | pub fn async_kw_token(&self) -> Option<AsyncKw> { support::token(&self.syntax) } | 858 | pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } |
823 | pub fn move_kw_token(&self) -> Option<MoveKw> { support::token(&self.syntax) } | 859 | pub fn move_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![move]) } |
824 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 860 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
825 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 861 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
826 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } | 862 | pub fn body(&self) -> Option<Expr> { support::child(&self.syntax) } |
827 | } | 863 | } |
864 | |||
828 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 865 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
829 | pub struct IfExpr { | 866 | pub struct IfExpr { |
830 | pub(crate) syntax: SyntaxNode, | 867 | pub(crate) syntax: SyntaxNode, |
@@ -842,9 +879,10 @@ impl AstNode for IfExpr { | |||
842 | } | 879 | } |
843 | impl ast::AttrsOwner for IfExpr {} | 880 | impl ast::AttrsOwner for IfExpr {} |
844 | impl IfExpr { | 881 | impl IfExpr { |
845 | pub fn if_kw_token(&self) -> Option<IfKw> { support::token(&self.syntax) } | 882 | pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) } |
846 | pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } | 883 | pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } |
847 | } | 884 | } |
885 | |||
848 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 886 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
849 | pub struct LoopExpr { | 887 | pub struct LoopExpr { |
850 | pub(crate) syntax: SyntaxNode, | 888 | pub(crate) syntax: SyntaxNode, |
@@ -863,8 +901,9 @@ impl AstNode for LoopExpr { | |||
863 | impl ast::AttrsOwner for LoopExpr {} | 901 | impl ast::AttrsOwner for LoopExpr {} |
864 | impl ast::LoopBodyOwner for LoopExpr {} | 902 | impl ast::LoopBodyOwner for LoopExpr {} |
865 | impl LoopExpr { | 903 | impl LoopExpr { |
866 | pub fn loop_kw_token(&self) -> Option<LoopKw> { support::token(&self.syntax) } | 904 | pub fn loop_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![loop]) } |
867 | } | 905 | } |
906 | |||
868 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 907 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
869 | pub struct TryBlockExpr { | 908 | pub struct TryBlockExpr { |
870 | pub(crate) syntax: SyntaxNode, | 909 | pub(crate) syntax: SyntaxNode, |
@@ -882,9 +921,10 @@ impl AstNode for TryBlockExpr { | |||
882 | } | 921 | } |
883 | impl ast::AttrsOwner for TryBlockExpr {} | 922 | impl ast::AttrsOwner for TryBlockExpr {} |
884 | impl TryBlockExpr { | 923 | impl TryBlockExpr { |
885 | pub fn try_kw_token(&self) -> Option<TryKw> { support::token(&self.syntax) } | 924 | pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) } |
886 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } | 925 | pub fn body(&self) -> Option<BlockExpr> { support::child(&self.syntax) } |
887 | } | 926 | } |
927 | |||
888 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 928 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
889 | pub struct ForExpr { | 929 | pub struct ForExpr { |
890 | pub(crate) syntax: SyntaxNode, | 930 | pub(crate) syntax: SyntaxNode, |
@@ -903,11 +943,12 @@ impl AstNode for ForExpr { | |||
903 | impl ast::AttrsOwner for ForExpr {} | 943 | impl ast::AttrsOwner for ForExpr {} |
904 | impl ast::LoopBodyOwner for ForExpr {} | 944 | impl ast::LoopBodyOwner for ForExpr {} |
905 | impl ForExpr { | 945 | impl ForExpr { |
906 | pub fn for_kw_token(&self) -> Option<ForKw> { support::token(&self.syntax) } | 946 | pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } |
907 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 947 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
908 | pub fn in_kw_token(&self) -> Option<InKw> { support::token(&self.syntax) } | 948 | pub fn in_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![in]) } |
909 | pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) } | 949 | pub fn iterable(&self) -> Option<Expr> { support::child(&self.syntax) } |
910 | } | 950 | } |
951 | |||
911 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 952 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
912 | pub struct WhileExpr { | 953 | pub struct WhileExpr { |
913 | pub(crate) syntax: SyntaxNode, | 954 | pub(crate) syntax: SyntaxNode, |
@@ -926,9 +967,10 @@ impl AstNode for WhileExpr { | |||
926 | impl ast::AttrsOwner for WhileExpr {} | 967 | impl ast::AttrsOwner for WhileExpr {} |
927 | impl ast::LoopBodyOwner for WhileExpr {} | 968 | impl ast::LoopBodyOwner for WhileExpr {} |
928 | impl WhileExpr { | 969 | impl WhileExpr { |
929 | pub fn while_kw_token(&self) -> Option<WhileKw> { support::token(&self.syntax) } | 970 | pub fn while_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![while]) } |
930 | pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } | 971 | pub fn condition(&self) -> Option<Condition> { support::child(&self.syntax) } |
931 | } | 972 | } |
973 | |||
932 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 974 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
933 | pub struct ContinueExpr { | 975 | pub struct ContinueExpr { |
934 | pub(crate) syntax: SyntaxNode, | 976 | pub(crate) syntax: SyntaxNode, |
@@ -946,9 +988,14 @@ impl AstNode for ContinueExpr { | |||
946 | } | 988 | } |
947 | impl ast::AttrsOwner for ContinueExpr {} | 989 | impl ast::AttrsOwner for ContinueExpr {} |
948 | impl ContinueExpr { | 990 | impl ContinueExpr { |
949 | pub fn continue_kw_token(&self) -> Option<ContinueKw> { support::token(&self.syntax) } | 991 | pub fn continue_token(&self) -> Option<SyntaxToken> { |
950 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 992 | support::token(&self.syntax, T![continue]) |
993 | } | ||
994 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { | ||
995 | support::token(&self.syntax, T![lifetime]) | ||
996 | } | ||
951 | } | 997 | } |
998 | |||
952 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 999 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
953 | pub struct BreakExpr { | 1000 | pub struct BreakExpr { |
954 | pub(crate) syntax: SyntaxNode, | 1001 | pub(crate) syntax: SyntaxNode, |
@@ -966,10 +1013,13 @@ impl AstNode for BreakExpr { | |||
966 | } | 1013 | } |
967 | impl ast::AttrsOwner for BreakExpr {} | 1014 | impl ast::AttrsOwner for BreakExpr {} |
968 | impl BreakExpr { | 1015 | impl BreakExpr { |
969 | pub fn break_kw_token(&self) -> Option<BreakKw> { support::token(&self.syntax) } | 1016 | pub fn break_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![break]) } |
970 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 1017 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
1018 | support::token(&self.syntax, T![lifetime]) | ||
1019 | } | ||
971 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1020 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
972 | } | 1021 | } |
1022 | |||
973 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1023 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
974 | pub struct Label { | 1024 | pub struct Label { |
975 | pub(crate) syntax: SyntaxNode, | 1025 | pub(crate) syntax: SyntaxNode, |
@@ -986,8 +1036,11 @@ impl AstNode for Label { | |||
986 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1036 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
987 | } | 1037 | } |
988 | impl Label { | 1038 | impl Label { |
989 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 1039 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
1040 | support::token(&self.syntax, T![lifetime]) | ||
1041 | } | ||
990 | } | 1042 | } |
1043 | |||
991 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1044 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
992 | pub struct BlockExpr { | 1045 | pub struct BlockExpr { |
993 | pub(crate) syntax: SyntaxNode, | 1046 | pub(crate) syntax: SyntaxNode, |
@@ -1006,9 +1059,10 @@ impl AstNode for BlockExpr { | |||
1006 | impl ast::AttrsOwner for BlockExpr {} | 1059 | impl ast::AttrsOwner for BlockExpr {} |
1007 | impl BlockExpr { | 1060 | impl BlockExpr { |
1008 | pub fn label(&self) -> Option<Label> { support::child(&self.syntax) } | 1061 | pub fn label(&self) -> Option<Label> { support::child(&self.syntax) } |
1009 | pub fn unsafe_kw_token(&self) -> Option<UnsafeKw> { support::token(&self.syntax) } | 1062 | pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } |
1010 | pub fn block(&self) -> Option<Block> { support::child(&self.syntax) } | 1063 | pub fn block(&self) -> Option<Block> { support::child(&self.syntax) } |
1011 | } | 1064 | } |
1065 | |||
1012 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1066 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1013 | pub struct ReturnExpr { | 1067 | pub struct ReturnExpr { |
1014 | pub(crate) syntax: SyntaxNode, | 1068 | pub(crate) syntax: SyntaxNode, |
@@ -1028,6 +1082,7 @@ impl ast::AttrsOwner for ReturnExpr {} | |||
1028 | impl ReturnExpr { | 1082 | impl ReturnExpr { |
1029 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1083 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1030 | } | 1084 | } |
1085 | |||
1031 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1086 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1032 | pub struct CallExpr { | 1087 | pub struct CallExpr { |
1033 | pub(crate) syntax: SyntaxNode, | 1088 | pub(crate) syntax: SyntaxNode, |
@@ -1047,6 +1102,7 @@ impl ast::ArgListOwner for CallExpr {} | |||
1047 | impl CallExpr { | 1102 | impl CallExpr { |
1048 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1103 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1049 | } | 1104 | } |
1105 | |||
1050 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1106 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1051 | pub struct MethodCallExpr { | 1107 | pub struct MethodCallExpr { |
1052 | pub(crate) syntax: SyntaxNode, | 1108 | pub(crate) syntax: SyntaxNode, |
@@ -1066,10 +1122,11 @@ impl ast::AttrsOwner for MethodCallExpr {} | |||
1066 | impl ast::ArgListOwner for MethodCallExpr {} | 1122 | impl ast::ArgListOwner for MethodCallExpr {} |
1067 | impl MethodCallExpr { | 1123 | impl MethodCallExpr { |
1068 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1124 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1069 | pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) } | 1125 | pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) } |
1070 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 1126 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
1071 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } | 1127 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } |
1072 | } | 1128 | } |
1129 | |||
1073 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1130 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1074 | pub struct IndexExpr { | 1131 | pub struct IndexExpr { |
1075 | pub(crate) syntax: SyntaxNode, | 1132 | pub(crate) syntax: SyntaxNode, |
@@ -1087,9 +1144,10 @@ impl AstNode for IndexExpr { | |||
1087 | } | 1144 | } |
1088 | impl ast::AttrsOwner for IndexExpr {} | 1145 | impl ast::AttrsOwner for IndexExpr {} |
1089 | impl IndexExpr { | 1146 | impl IndexExpr { |
1090 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1147 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
1091 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1148 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
1092 | } | 1149 | } |
1150 | |||
1093 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1151 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1094 | pub struct FieldExpr { | 1152 | pub struct FieldExpr { |
1095 | pub(crate) syntax: SyntaxNode, | 1153 | pub(crate) syntax: SyntaxNode, |
@@ -1108,9 +1166,10 @@ impl AstNode for FieldExpr { | |||
1108 | impl ast::AttrsOwner for FieldExpr {} | 1166 | impl ast::AttrsOwner for FieldExpr {} |
1109 | impl FieldExpr { | 1167 | impl FieldExpr { |
1110 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1168 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1111 | pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) } | 1169 | pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) } |
1112 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 1170 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
1113 | } | 1171 | } |
1172 | |||
1114 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1173 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1115 | pub struct AwaitExpr { | 1174 | pub struct AwaitExpr { |
1116 | pub(crate) syntax: SyntaxNode, | 1175 | pub(crate) syntax: SyntaxNode, |
@@ -1129,9 +1188,10 @@ impl AstNode for AwaitExpr { | |||
1129 | impl ast::AttrsOwner for AwaitExpr {} | 1188 | impl ast::AttrsOwner for AwaitExpr {} |
1130 | impl AwaitExpr { | 1189 | impl AwaitExpr { |
1131 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1190 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1132 | pub fn dot_token(&self) -> Option<Dot> { support::token(&self.syntax) } | 1191 | pub fn dot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![.]) } |
1133 | pub fn await_kw_token(&self) -> Option<AwaitKw> { support::token(&self.syntax) } | 1192 | pub fn await_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![await]) } |
1134 | } | 1193 | } |
1194 | |||
1135 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1195 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1136 | pub struct TryExpr { | 1196 | pub struct TryExpr { |
1137 | pub(crate) syntax: SyntaxNode, | 1197 | pub(crate) syntax: SyntaxNode, |
@@ -1149,9 +1209,10 @@ impl AstNode for TryExpr { | |||
1149 | } | 1209 | } |
1150 | impl ast::AttrsOwner for TryExpr {} | 1210 | impl ast::AttrsOwner for TryExpr {} |
1151 | impl TryExpr { | 1211 | impl TryExpr { |
1152 | pub fn try_kw_token(&self) -> Option<TryKw> { support::token(&self.syntax) } | 1212 | pub fn try_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![try]) } |
1153 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1213 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1154 | } | 1214 | } |
1215 | |||
1155 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1216 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1156 | pub struct CastExpr { | 1217 | pub struct CastExpr { |
1157 | pub(crate) syntax: SyntaxNode, | 1218 | pub(crate) syntax: SyntaxNode, |
@@ -1170,9 +1231,10 @@ impl AstNode for CastExpr { | |||
1170 | impl ast::AttrsOwner for CastExpr {} | 1231 | impl ast::AttrsOwner for CastExpr {} |
1171 | impl CastExpr { | 1232 | impl CastExpr { |
1172 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1233 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1173 | pub fn as_kw_token(&self) -> Option<AsKw> { support::token(&self.syntax) } | 1234 | pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) } |
1174 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 1235 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
1175 | } | 1236 | } |
1237 | |||
1176 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1238 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1177 | pub struct RefExpr { | 1239 | pub struct RefExpr { |
1178 | pub(crate) syntax: SyntaxNode, | 1240 | pub(crate) syntax: SyntaxNode, |
@@ -1190,11 +1252,12 @@ impl AstNode for RefExpr { | |||
1190 | } | 1252 | } |
1191 | impl ast::AttrsOwner for RefExpr {} | 1253 | impl ast::AttrsOwner for RefExpr {} |
1192 | impl RefExpr { | 1254 | impl RefExpr { |
1193 | pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } | 1255 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
1194 | pub fn raw_kw_token(&self) -> Option<RawKw> { support::token(&self.syntax) } | 1256 | pub fn raw_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![raw]) } |
1195 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 1257 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
1196 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1258 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1197 | } | 1259 | } |
1260 | |||
1198 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1261 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1199 | pub struct PrefixExpr { | 1262 | pub struct PrefixExpr { |
1200 | pub(crate) syntax: SyntaxNode, | 1263 | pub(crate) syntax: SyntaxNode, |
@@ -1212,9 +1275,9 @@ impl AstNode for PrefixExpr { | |||
1212 | } | 1275 | } |
1213 | impl ast::AttrsOwner for PrefixExpr {} | 1276 | impl ast::AttrsOwner for PrefixExpr {} |
1214 | impl PrefixExpr { | 1277 | impl PrefixExpr { |
1215 | pub fn prefix_op_token(&self) -> Option<PrefixOp> { support::token(&self.syntax) } | ||
1216 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1278 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1217 | } | 1279 | } |
1280 | |||
1218 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1281 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1219 | pub struct BoxExpr { | 1282 | pub struct BoxExpr { |
1220 | pub(crate) syntax: SyntaxNode, | 1283 | pub(crate) syntax: SyntaxNode, |
@@ -1232,9 +1295,10 @@ impl AstNode for BoxExpr { | |||
1232 | } | 1295 | } |
1233 | impl ast::AttrsOwner for BoxExpr {} | 1296 | impl ast::AttrsOwner for BoxExpr {} |
1234 | impl BoxExpr { | 1297 | impl BoxExpr { |
1235 | pub fn box_kw_token(&self) -> Option<BoxKw> { support::token(&self.syntax) } | 1298 | pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) } |
1236 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1299 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1237 | } | 1300 | } |
1301 | |||
1238 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1302 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1239 | pub struct RangeExpr { | 1303 | pub struct RangeExpr { |
1240 | pub(crate) syntax: SyntaxNode, | 1304 | pub(crate) syntax: SyntaxNode, |
@@ -1251,9 +1315,8 @@ impl AstNode for RangeExpr { | |||
1251 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1315 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1252 | } | 1316 | } |
1253 | impl ast::AttrsOwner for RangeExpr {} | 1317 | impl ast::AttrsOwner for RangeExpr {} |
1254 | impl RangeExpr { | 1318 | impl RangeExpr {} |
1255 | pub fn range_op_token(&self) -> Option<RangeOp> { support::token(&self.syntax) } | 1319 | |
1256 | } | ||
1257 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1320 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1258 | pub struct BinExpr { | 1321 | pub struct BinExpr { |
1259 | pub(crate) syntax: SyntaxNode, | 1322 | pub(crate) syntax: SyntaxNode, |
@@ -1270,9 +1333,8 @@ impl AstNode for BinExpr { | |||
1270 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1333 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1271 | } | 1334 | } |
1272 | impl ast::AttrsOwner for BinExpr {} | 1335 | impl ast::AttrsOwner for BinExpr {} |
1273 | impl BinExpr { | 1336 | impl BinExpr {} |
1274 | pub fn bin_op_token(&self) -> Option<BinOp> { support::token(&self.syntax) } | 1337 | |
1275 | } | ||
1276 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1338 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1277 | pub struct Literal { | 1339 | pub struct Literal { |
1278 | pub(crate) syntax: SyntaxNode, | 1340 | pub(crate) syntax: SyntaxNode, |
@@ -1288,9 +1350,8 @@ impl AstNode for Literal { | |||
1288 | } | 1350 | } |
1289 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1351 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1290 | } | 1352 | } |
1291 | impl Literal { | 1353 | impl Literal {} |
1292 | pub fn literal_token_token(&self) -> Option<LiteralToken> { support::token(&self.syntax) } | 1354 | |
1293 | } | ||
1294 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1355 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1295 | pub struct MatchExpr { | 1356 | pub struct MatchExpr { |
1296 | pub(crate) syntax: SyntaxNode, | 1357 | pub(crate) syntax: SyntaxNode, |
@@ -1308,10 +1369,11 @@ impl AstNode for MatchExpr { | |||
1308 | } | 1369 | } |
1309 | impl ast::AttrsOwner for MatchExpr {} | 1370 | impl ast::AttrsOwner for MatchExpr {} |
1310 | impl MatchExpr { | 1371 | impl MatchExpr { |
1311 | pub fn match_kw_token(&self) -> Option<MatchKw> { support::token(&self.syntax) } | 1372 | pub fn match_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![match]) } |
1312 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1373 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1313 | pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) } | 1374 | pub fn match_arm_list(&self) -> Option<MatchArmList> { support::child(&self.syntax) } |
1314 | } | 1375 | } |
1376 | |||
1315 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1377 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1316 | pub struct MatchArmList { | 1378 | pub struct MatchArmList { |
1317 | pub(crate) syntax: SyntaxNode, | 1379 | pub(crate) syntax: SyntaxNode, |
@@ -1329,10 +1391,11 @@ impl AstNode for MatchArmList { | |||
1329 | } | 1391 | } |
1330 | impl ast::AttrsOwner for MatchArmList {} | 1392 | impl ast::AttrsOwner for MatchArmList {} |
1331 | impl MatchArmList { | 1393 | impl MatchArmList { |
1332 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 1394 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
1333 | pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) } | 1395 | pub fn arms(&self) -> AstChildren<MatchArm> { support::children(&self.syntax) } |
1334 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 1396 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
1335 | } | 1397 | } |
1398 | |||
1336 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1399 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1337 | pub struct MatchArm { | 1400 | pub struct MatchArm { |
1338 | pub(crate) syntax: SyntaxNode, | 1401 | pub(crate) syntax: SyntaxNode, |
@@ -1352,9 +1415,10 @@ impl ast::AttrsOwner for MatchArm {} | |||
1352 | impl MatchArm { | 1415 | impl MatchArm { |
1353 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1416 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1354 | pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) } | 1417 | pub fn guard(&self) -> Option<MatchGuard> { support::child(&self.syntax) } |
1355 | pub fn fat_arrow_token(&self) -> Option<FatArrow> { support::token(&self.syntax) } | 1418 | pub fn fat_arrow_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=>]) } |
1356 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1419 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1357 | } | 1420 | } |
1421 | |||
1358 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1422 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1359 | pub struct MatchGuard { | 1423 | pub struct MatchGuard { |
1360 | pub(crate) syntax: SyntaxNode, | 1424 | pub(crate) syntax: SyntaxNode, |
@@ -1371,9 +1435,10 @@ impl AstNode for MatchGuard { | |||
1371 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1435 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1372 | } | 1436 | } |
1373 | impl MatchGuard { | 1437 | impl MatchGuard { |
1374 | pub fn if_kw_token(&self) -> Option<IfKw> { support::token(&self.syntax) } | 1438 | pub fn if_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![if]) } |
1375 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1439 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1376 | } | 1440 | } |
1441 | |||
1377 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1442 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1378 | pub struct RecordLit { | 1443 | pub struct RecordLit { |
1379 | pub(crate) syntax: SyntaxNode, | 1444 | pub(crate) syntax: SyntaxNode, |
@@ -1393,6 +1458,7 @@ impl RecordLit { | |||
1393 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1458 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1394 | pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) } | 1459 | pub fn record_field_list(&self) -> Option<RecordFieldList> { support::child(&self.syntax) } |
1395 | } | 1460 | } |
1461 | |||
1396 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1462 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1397 | pub struct RecordFieldList { | 1463 | pub struct RecordFieldList { |
1398 | pub(crate) syntax: SyntaxNode, | 1464 | pub(crate) syntax: SyntaxNode, |
@@ -1409,12 +1475,13 @@ impl AstNode for RecordFieldList { | |||
1409 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1475 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1410 | } | 1476 | } |
1411 | impl RecordFieldList { | 1477 | impl RecordFieldList { |
1412 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 1478 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
1413 | pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) } | 1479 | pub fn fields(&self) -> AstChildren<RecordField> { support::children(&self.syntax) } |
1414 | pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) } | 1480 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } |
1415 | pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) } | 1481 | pub fn spread(&self) -> Option<Expr> { support::child(&self.syntax) } |
1416 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 1482 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
1417 | } | 1483 | } |
1484 | |||
1418 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1485 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1419 | pub struct RecordField { | 1486 | pub struct RecordField { |
1420 | pub(crate) syntax: SyntaxNode, | 1487 | pub(crate) syntax: SyntaxNode, |
@@ -1433,9 +1500,10 @@ impl AstNode for RecordField { | |||
1433 | impl ast::AttrsOwner for RecordField {} | 1500 | impl ast::AttrsOwner for RecordField {} |
1434 | impl RecordField { | 1501 | impl RecordField { |
1435 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 1502 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
1436 | pub fn colon_token(&self) -> Option<Colon> { support::token(&self.syntax) } | 1503 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
1437 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 1504 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
1438 | } | 1505 | } |
1506 | |||
1439 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1507 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1440 | pub struct OrPat { | 1508 | pub struct OrPat { |
1441 | pub(crate) syntax: SyntaxNode, | 1509 | pub(crate) syntax: SyntaxNode, |
@@ -1454,6 +1522,7 @@ impl AstNode for OrPat { | |||
1454 | impl OrPat { | 1522 | impl OrPat { |
1455 | pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1523 | pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1456 | } | 1524 | } |
1525 | |||
1457 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1526 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1458 | pub struct ParenPat { | 1527 | pub struct ParenPat { |
1459 | pub(crate) syntax: SyntaxNode, | 1528 | pub(crate) syntax: SyntaxNode, |
@@ -1470,10 +1539,11 @@ impl AstNode for ParenPat { | |||
1470 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1539 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1471 | } | 1540 | } |
1472 | impl ParenPat { | 1541 | impl ParenPat { |
1473 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1542 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
1474 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1543 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1475 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1544 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
1476 | } | 1545 | } |
1546 | |||
1477 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1547 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1478 | pub struct RefPat { | 1548 | pub struct RefPat { |
1479 | pub(crate) syntax: SyntaxNode, | 1549 | pub(crate) syntax: SyntaxNode, |
@@ -1490,10 +1560,11 @@ impl AstNode for RefPat { | |||
1490 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1560 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1491 | } | 1561 | } |
1492 | impl RefPat { | 1562 | impl RefPat { |
1493 | pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } | 1563 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
1494 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 1564 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
1495 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1565 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1496 | } | 1566 | } |
1567 | |||
1497 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1568 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1498 | pub struct BoxPat { | 1569 | pub struct BoxPat { |
1499 | pub(crate) syntax: SyntaxNode, | 1570 | pub(crate) syntax: SyntaxNode, |
@@ -1510,9 +1581,10 @@ impl AstNode for BoxPat { | |||
1510 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1581 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1511 | } | 1582 | } |
1512 | impl BoxPat { | 1583 | impl BoxPat { |
1513 | pub fn box_kw_token(&self) -> Option<BoxKw> { support::token(&self.syntax) } | 1584 | pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) } |
1514 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1585 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1515 | } | 1586 | } |
1587 | |||
1516 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1588 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1517 | pub struct BindPat { | 1589 | pub struct BindPat { |
1518 | pub(crate) syntax: SyntaxNode, | 1590 | pub(crate) syntax: SyntaxNode, |
@@ -1531,11 +1603,12 @@ impl AstNode for BindPat { | |||
1531 | impl ast::AttrsOwner for BindPat {} | 1603 | impl ast::AttrsOwner for BindPat {} |
1532 | impl ast::NameOwner for BindPat {} | 1604 | impl ast::NameOwner for BindPat {} |
1533 | impl BindPat { | 1605 | impl BindPat { |
1534 | pub fn ref_kw_token(&self) -> Option<RefKw> { support::token(&self.syntax) } | 1606 | pub fn ref_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ref]) } |
1535 | pub fn mut_kw_token(&self) -> Option<MutKw> { support::token(&self.syntax) } | 1607 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
1536 | pub fn at_token(&self) -> Option<At> { support::token(&self.syntax) } | 1608 | pub fn at_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![@]) } |
1537 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1609 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1538 | } | 1610 | } |
1611 | |||
1539 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1612 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1540 | pub struct PlaceholderPat { | 1613 | pub struct PlaceholderPat { |
1541 | pub(crate) syntax: SyntaxNode, | 1614 | pub(crate) syntax: SyntaxNode, |
@@ -1552,8 +1625,9 @@ impl AstNode for PlaceholderPat { | |||
1552 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1625 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1553 | } | 1626 | } |
1554 | impl PlaceholderPat { | 1627 | impl PlaceholderPat { |
1555 | pub fn underscore_token(&self) -> Option<Underscore> { support::token(&self.syntax) } | 1628 | pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } |
1556 | } | 1629 | } |
1630 | |||
1557 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1631 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1558 | pub struct DotDotPat { | 1632 | pub struct DotDotPat { |
1559 | pub(crate) syntax: SyntaxNode, | 1633 | pub(crate) syntax: SyntaxNode, |
@@ -1570,8 +1644,9 @@ impl AstNode for DotDotPat { | |||
1570 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1644 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1571 | } | 1645 | } |
1572 | impl DotDotPat { | 1646 | impl DotDotPat { |
1573 | pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) } | 1647 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } |
1574 | } | 1648 | } |
1649 | |||
1575 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1650 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1576 | pub struct PathPat { | 1651 | pub struct PathPat { |
1577 | pub(crate) syntax: SyntaxNode, | 1652 | pub(crate) syntax: SyntaxNode, |
@@ -1590,6 +1665,7 @@ impl AstNode for PathPat { | |||
1590 | impl PathPat { | 1665 | impl PathPat { |
1591 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1666 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1592 | } | 1667 | } |
1668 | |||
1593 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1669 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1594 | pub struct SlicePat { | 1670 | pub struct SlicePat { |
1595 | pub(crate) syntax: SyntaxNode, | 1671 | pub(crate) syntax: SyntaxNode, |
@@ -1606,10 +1682,11 @@ impl AstNode for SlicePat { | |||
1606 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1682 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1607 | } | 1683 | } |
1608 | impl SlicePat { | 1684 | impl SlicePat { |
1609 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1685 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
1610 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1686 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1611 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1687 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
1612 | } | 1688 | } |
1689 | |||
1613 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1690 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1614 | pub struct RangePat { | 1691 | pub struct RangePat { |
1615 | pub(crate) syntax: SyntaxNode, | 1692 | pub(crate) syntax: SyntaxNode, |
@@ -1625,9 +1702,8 @@ impl AstNode for RangePat { | |||
1625 | } | 1702 | } |
1626 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1703 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1627 | } | 1704 | } |
1628 | impl RangePat { | 1705 | impl RangePat {} |
1629 | pub fn range_separator_token(&self) -> Option<RangeSeparator> { support::token(&self.syntax) } | 1706 | |
1630 | } | ||
1631 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1707 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1632 | pub struct LiteralPat { | 1708 | pub struct LiteralPat { |
1633 | pub(crate) syntax: SyntaxNode, | 1709 | pub(crate) syntax: SyntaxNode, |
@@ -1646,6 +1722,7 @@ impl AstNode for LiteralPat { | |||
1646 | impl LiteralPat { | 1722 | impl LiteralPat { |
1647 | pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) } | 1723 | pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) } |
1648 | } | 1724 | } |
1725 | |||
1649 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1726 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1650 | pub struct MacroPat { | 1727 | pub struct MacroPat { |
1651 | pub(crate) syntax: SyntaxNode, | 1728 | pub(crate) syntax: SyntaxNode, |
@@ -1664,6 +1741,7 @@ impl AstNode for MacroPat { | |||
1664 | impl MacroPat { | 1741 | impl MacroPat { |
1665 | pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) } | 1742 | pub fn macro_call(&self) -> Option<MacroCall> { support::child(&self.syntax) } |
1666 | } | 1743 | } |
1744 | |||
1667 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1745 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1668 | pub struct RecordPat { | 1746 | pub struct RecordPat { |
1669 | pub(crate) syntax: SyntaxNode, | 1747 | pub(crate) syntax: SyntaxNode, |
@@ -1685,6 +1763,7 @@ impl RecordPat { | |||
1685 | } | 1763 | } |
1686 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1764 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1687 | } | 1765 | } |
1766 | |||
1688 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1767 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1689 | pub struct RecordFieldPatList { | 1768 | pub struct RecordFieldPatList { |
1690 | pub(crate) syntax: SyntaxNode, | 1769 | pub(crate) syntax: SyntaxNode, |
@@ -1701,15 +1780,16 @@ impl AstNode for RecordFieldPatList { | |||
1701 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1780 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1702 | } | 1781 | } |
1703 | impl RecordFieldPatList { | 1782 | impl RecordFieldPatList { |
1704 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 1783 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
1705 | pub fn pats(&self) -> AstChildren<RecordInnerPat> { support::children(&self.syntax) } | 1784 | pub fn pats(&self) -> AstChildren<RecordInnerPat> { support::children(&self.syntax) } |
1706 | pub fn record_field_pats(&self) -> AstChildren<RecordFieldPat> { | 1785 | pub fn record_field_pats(&self) -> AstChildren<RecordFieldPat> { |
1707 | support::children(&self.syntax) | 1786 | support::children(&self.syntax) |
1708 | } | 1787 | } |
1709 | pub fn bind_pats(&self) -> AstChildren<BindPat> { support::children(&self.syntax) } | 1788 | pub fn bind_pats(&self) -> AstChildren<BindPat> { support::children(&self.syntax) } |
1710 | pub fn dotdot_token(&self) -> Option<Dotdot> { support::token(&self.syntax) } | 1789 | pub fn dotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![..]) } |
1711 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 1790 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
1712 | } | 1791 | } |
1792 | |||
1713 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1793 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1714 | pub struct RecordFieldPat { | 1794 | pub struct RecordFieldPat { |
1715 | pub(crate) syntax: SyntaxNode, | 1795 | pub(crate) syntax: SyntaxNode, |
@@ -1728,9 +1808,10 @@ impl AstNode for RecordFieldPat { | |||
1728 | impl ast::AttrsOwner for RecordFieldPat {} | 1808 | impl ast::AttrsOwner for RecordFieldPat {} |
1729 | impl ast::NameOwner for RecordFieldPat {} | 1809 | impl ast::NameOwner for RecordFieldPat {} |
1730 | impl RecordFieldPat { | 1810 | impl RecordFieldPat { |
1731 | pub fn colon_token(&self) -> Option<Colon> { support::token(&self.syntax) } | 1811 | pub fn colon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![:]) } |
1732 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 1812 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1733 | } | 1813 | } |
1814 | |||
1734 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1815 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1735 | pub struct TupleStructPat { | 1816 | pub struct TupleStructPat { |
1736 | pub(crate) syntax: SyntaxNode, | 1817 | pub(crate) syntax: SyntaxNode, |
@@ -1748,10 +1829,11 @@ impl AstNode for TupleStructPat { | |||
1748 | } | 1829 | } |
1749 | impl TupleStructPat { | 1830 | impl TupleStructPat { |
1750 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1831 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1751 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1832 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
1752 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1833 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1753 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1834 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
1754 | } | 1835 | } |
1836 | |||
1755 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1837 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1756 | pub struct TuplePat { | 1838 | pub struct TuplePat { |
1757 | pub(crate) syntax: SyntaxNode, | 1839 | pub(crate) syntax: SyntaxNode, |
@@ -1768,10 +1850,11 @@ impl AstNode for TuplePat { | |||
1768 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1850 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1769 | } | 1851 | } |
1770 | impl TuplePat { | 1852 | impl TuplePat { |
1771 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 1853 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
1772 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } | 1854 | pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) } |
1773 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 1855 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
1774 | } | 1856 | } |
1857 | |||
1775 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1858 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1776 | pub struct Visibility { | 1859 | pub struct Visibility { |
1777 | pub(crate) syntax: SyntaxNode, | 1860 | pub(crate) syntax: SyntaxNode, |
@@ -1788,11 +1871,12 @@ impl AstNode for Visibility { | |||
1788 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1871 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1789 | } | 1872 | } |
1790 | impl Visibility { | 1873 | impl Visibility { |
1791 | pub fn pub_kw_token(&self) -> Option<PubKw> { support::token(&self.syntax) } | 1874 | pub fn pub_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![pub]) } |
1792 | pub fn super_kw_token(&self) -> Option<SuperKw> { support::token(&self.syntax) } | 1875 | pub fn super_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![super]) } |
1793 | pub fn self_kw_token(&self) -> Option<SelfKw> { support::token(&self.syntax) } | 1876 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } |
1794 | pub fn crate_kw_token(&self) -> Option<CrateKw> { support::token(&self.syntax) } | 1877 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } |
1795 | } | 1878 | } |
1879 | |||
1796 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1880 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1797 | pub struct Name { | 1881 | pub struct Name { |
1798 | pub(crate) syntax: SyntaxNode, | 1882 | pub(crate) syntax: SyntaxNode, |
@@ -1809,8 +1893,9 @@ impl AstNode for Name { | |||
1809 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1893 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1810 | } | 1894 | } |
1811 | impl Name { | 1895 | impl Name { |
1812 | pub fn ident_token(&self) -> Option<Ident> { support::token(&self.syntax) } | 1896 | pub fn ident_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![ident]) } |
1813 | } | 1897 | } |
1898 | |||
1814 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1899 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1815 | pub struct NameRef { | 1900 | pub struct NameRef { |
1816 | pub(crate) syntax: SyntaxNode, | 1901 | pub(crate) syntax: SyntaxNode, |
@@ -1826,9 +1911,8 @@ impl AstNode for NameRef { | |||
1826 | } | 1911 | } |
1827 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1912 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1828 | } | 1913 | } |
1829 | impl NameRef { | 1914 | impl NameRef {} |
1830 | pub fn name_ref_token_token(&self) -> Option<NameRefToken> { support::token(&self.syntax) } | 1915 | |
1831 | } | ||
1832 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1916 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1833 | pub struct MacroCall { | 1917 | pub struct MacroCall { |
1834 | pub(crate) syntax: SyntaxNode, | 1918 | pub(crate) syntax: SyntaxNode, |
@@ -1849,10 +1933,11 @@ impl ast::AttrsOwner for MacroCall {} | |||
1849 | impl ast::DocCommentsOwner for MacroCall {} | 1933 | impl ast::DocCommentsOwner for MacroCall {} |
1850 | impl MacroCall { | 1934 | impl MacroCall { |
1851 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1935 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1852 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 1936 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
1853 | pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) } | 1937 | pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) } |
1854 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 1938 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
1855 | } | 1939 | } |
1940 | |||
1856 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1941 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1857 | pub struct Attr { | 1942 | pub struct Attr { |
1858 | pub(crate) syntax: SyntaxNode, | 1943 | pub(crate) syntax: SyntaxNode, |
@@ -1869,14 +1954,15 @@ impl AstNode for Attr { | |||
1869 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1954 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1870 | } | 1955 | } |
1871 | impl Attr { | 1956 | impl Attr { |
1872 | pub fn pound_token(&self) -> Option<Pound> { support::token(&self.syntax) } | 1957 | pub fn pound_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![#]) } |
1873 | pub fn excl_token(&self) -> Option<Excl> { support::token(&self.syntax) } | 1958 | pub fn excl_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![!]) } |
1874 | pub fn l_brack_token(&self) -> Option<LBrack> { support::token(&self.syntax) } | 1959 | pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) } |
1875 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1960 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
1876 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 1961 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
1877 | pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) } | 1962 | pub fn input(&self) -> Option<AttrInput> { support::child(&self.syntax) } |
1878 | pub fn r_brack_token(&self) -> Option<RBrack> { support::token(&self.syntax) } | 1963 | pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) } |
1879 | } | 1964 | } |
1965 | |||
1880 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1966 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1881 | pub struct TokenTree { | 1967 | pub struct TokenTree { |
1882 | pub(crate) syntax: SyntaxNode, | 1968 | pub(crate) syntax: SyntaxNode, |
@@ -1893,6 +1979,7 @@ impl AstNode for TokenTree { | |||
1893 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1979 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1894 | } | 1980 | } |
1895 | impl TokenTree {} | 1981 | impl TokenTree {} |
1982 | |||
1896 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1983 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1897 | pub struct TypeParamList { | 1984 | pub struct TypeParamList { |
1898 | pub(crate) syntax: SyntaxNode, | 1985 | pub(crate) syntax: SyntaxNode, |
@@ -1909,13 +1996,14 @@ impl AstNode for TypeParamList { | |||
1909 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1996 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1910 | } | 1997 | } |
1911 | impl TypeParamList { | 1998 | impl TypeParamList { |
1912 | pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) } | 1999 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } |
1913 | pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) } | 2000 | pub fn generic_params(&self) -> AstChildren<GenericParam> { support::children(&self.syntax) } |
1914 | pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) } | 2001 | pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) } |
1915 | pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) } | 2002 | pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) } |
1916 | pub fn const_params(&self) -> AstChildren<ConstParam> { support::children(&self.syntax) } | 2003 | pub fn const_params(&self) -> AstChildren<ConstParam> { support::children(&self.syntax) } |
1917 | pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) } | 2004 | pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) } |
1918 | } | 2005 | } |
2006 | |||
1919 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2007 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1920 | pub struct TypeParam { | 2008 | pub struct TypeParam { |
1921 | pub(crate) syntax: SyntaxNode, | 2009 | pub(crate) syntax: SyntaxNode, |
@@ -1935,9 +2023,10 @@ impl ast::NameOwner for TypeParam {} | |||
1935 | impl ast::AttrsOwner for TypeParam {} | 2023 | impl ast::AttrsOwner for TypeParam {} |
1936 | impl ast::TypeBoundsOwner for TypeParam {} | 2024 | impl ast::TypeBoundsOwner for TypeParam {} |
1937 | impl TypeParam { | 2025 | impl TypeParam { |
1938 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2026 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
1939 | pub fn default_type(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2027 | pub fn default_type(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
1940 | } | 2028 | } |
2029 | |||
1941 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2030 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1942 | pub struct ConstParam { | 2031 | pub struct ConstParam { |
1943 | pub(crate) syntax: SyntaxNode, | 2032 | pub(crate) syntax: SyntaxNode, |
@@ -1957,9 +2046,10 @@ impl ast::NameOwner for ConstParam {} | |||
1957 | impl ast::AttrsOwner for ConstParam {} | 2046 | impl ast::AttrsOwner for ConstParam {} |
1958 | impl ast::TypeAscriptionOwner for ConstParam {} | 2047 | impl ast::TypeAscriptionOwner for ConstParam {} |
1959 | impl ConstParam { | 2048 | impl ConstParam { |
1960 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2049 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
1961 | pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) } | 2050 | pub fn default_val(&self) -> Option<Expr> { support::child(&self.syntax) } |
1962 | } | 2051 | } |
2052 | |||
1963 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2053 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1964 | pub struct LifetimeParam { | 2054 | pub struct LifetimeParam { |
1965 | pub(crate) syntax: SyntaxNode, | 2055 | pub(crate) syntax: SyntaxNode, |
@@ -1977,8 +2067,11 @@ impl AstNode for LifetimeParam { | |||
1977 | } | 2067 | } |
1978 | impl ast::AttrsOwner for LifetimeParam {} | 2068 | impl ast::AttrsOwner for LifetimeParam {} |
1979 | impl LifetimeParam { | 2069 | impl LifetimeParam { |
1980 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2070 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
2071 | support::token(&self.syntax, T![lifetime]) | ||
2072 | } | ||
1981 | } | 2073 | } |
2074 | |||
1982 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2075 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1983 | pub struct TypeBound { | 2076 | pub struct TypeBound { |
1984 | pub(crate) syntax: SyntaxNode, | 2077 | pub(crate) syntax: SyntaxNode, |
@@ -1995,10 +2088,13 @@ impl AstNode for TypeBound { | |||
1995 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2088 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1996 | } | 2089 | } |
1997 | impl TypeBound { | 2090 | impl TypeBound { |
1998 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2091 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
1999 | pub fn const_kw_token(&self) -> Option<ConstKw> { support::token(&self.syntax) } | 2092 | support::token(&self.syntax, T![lifetime]) |
2093 | } | ||
2094 | pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } | ||
2000 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2095 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
2001 | } | 2096 | } |
2097 | |||
2002 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2098 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2003 | pub struct TypeBoundList { | 2099 | pub struct TypeBoundList { |
2004 | pub(crate) syntax: SyntaxNode, | 2100 | pub(crate) syntax: SyntaxNode, |
@@ -2017,6 +2113,7 @@ impl AstNode for TypeBoundList { | |||
2017 | impl TypeBoundList { | 2113 | impl TypeBoundList { |
2018 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } | 2114 | pub fn bounds(&self) -> AstChildren<TypeBound> { support::children(&self.syntax) } |
2019 | } | 2115 | } |
2116 | |||
2020 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2117 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2021 | pub struct WherePred { | 2118 | pub struct WherePred { |
2022 | pub(crate) syntax: SyntaxNode, | 2119 | pub(crate) syntax: SyntaxNode, |
@@ -2034,9 +2131,12 @@ impl AstNode for WherePred { | |||
2034 | } | 2131 | } |
2035 | impl ast::TypeBoundsOwner for WherePred {} | 2132 | impl ast::TypeBoundsOwner for WherePred {} |
2036 | impl WherePred { | 2133 | impl WherePred { |
2037 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2134 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
2135 | support::token(&self.syntax, T![lifetime]) | ||
2136 | } | ||
2038 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2137 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
2039 | } | 2138 | } |
2139 | |||
2040 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2140 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2041 | pub struct WhereClause { | 2141 | pub struct WhereClause { |
2042 | pub(crate) syntax: SyntaxNode, | 2142 | pub(crate) syntax: SyntaxNode, |
@@ -2053,9 +2153,10 @@ impl AstNode for WhereClause { | |||
2053 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2153 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2054 | } | 2154 | } |
2055 | impl WhereClause { | 2155 | impl WhereClause { |
2056 | pub fn where_kw_token(&self) -> Option<WhereKw> { support::token(&self.syntax) } | 2156 | pub fn where_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![where]) } |
2057 | pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) } | 2157 | pub fn predicates(&self) -> AstChildren<WherePred> { support::children(&self.syntax) } |
2058 | } | 2158 | } |
2159 | |||
2059 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2160 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2060 | pub struct Abi { | 2161 | pub struct Abi { |
2061 | pub(crate) syntax: SyntaxNode, | 2162 | pub(crate) syntax: SyntaxNode, |
@@ -2071,9 +2172,8 @@ impl AstNode for Abi { | |||
2071 | } | 2172 | } |
2072 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2173 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2073 | } | 2174 | } |
2074 | impl Abi { | 2175 | impl Abi {} |
2075 | pub fn string_token(&self) -> Option<String> { support::token(&self.syntax) } | 2176 | |
2076 | } | ||
2077 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2177 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2078 | pub struct ExprStmt { | 2178 | pub struct ExprStmt { |
2079 | pub(crate) syntax: SyntaxNode, | 2179 | pub(crate) syntax: SyntaxNode, |
@@ -2092,8 +2192,9 @@ impl AstNode for ExprStmt { | |||
2092 | impl ast::AttrsOwner for ExprStmt {} | 2192 | impl ast::AttrsOwner for ExprStmt {} |
2093 | impl ExprStmt { | 2193 | impl ExprStmt { |
2094 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 2194 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
2095 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 2195 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
2096 | } | 2196 | } |
2197 | |||
2097 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2198 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2098 | pub struct LetStmt { | 2199 | pub struct LetStmt { |
2099 | pub(crate) syntax: SyntaxNode, | 2200 | pub(crate) syntax: SyntaxNode, |
@@ -2112,12 +2213,13 @@ impl AstNode for LetStmt { | |||
2112 | impl ast::AttrsOwner for LetStmt {} | 2213 | impl ast::AttrsOwner for LetStmt {} |
2113 | impl ast::TypeAscriptionOwner for LetStmt {} | 2214 | impl ast::TypeAscriptionOwner for LetStmt {} |
2114 | impl LetStmt { | 2215 | impl LetStmt { |
2115 | pub fn let_kw_token(&self) -> Option<LetKw> { support::token(&self.syntax) } | 2216 | pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) } |
2116 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 2217 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
2117 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2218 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2118 | pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) } | 2219 | pub fn initializer(&self) -> Option<Expr> { support::child(&self.syntax) } |
2119 | pub fn semi_token(&self) -> Option<Semi> { support::token(&self.syntax) } | 2220 | pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } |
2120 | } | 2221 | } |
2222 | |||
2121 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2223 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2122 | pub struct Condition { | 2224 | pub struct Condition { |
2123 | pub(crate) syntax: SyntaxNode, | 2225 | pub(crate) syntax: SyntaxNode, |
@@ -2134,11 +2236,12 @@ impl AstNode for Condition { | |||
2134 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2236 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2135 | } | 2237 | } |
2136 | impl Condition { | 2238 | impl Condition { |
2137 | pub fn let_kw_token(&self) -> Option<LetKw> { support::token(&self.syntax) } | 2239 | pub fn let_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![let]) } |
2138 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 2240 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
2139 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2241 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2140 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 2242 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
2141 | } | 2243 | } |
2244 | |||
2142 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2245 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2143 | pub struct Block { | 2246 | pub struct Block { |
2144 | pub(crate) syntax: SyntaxNode, | 2247 | pub(crate) syntax: SyntaxNode, |
@@ -2157,11 +2260,12 @@ impl AstNode for Block { | |||
2157 | impl ast::AttrsOwner for Block {} | 2260 | impl ast::AttrsOwner for Block {} |
2158 | impl ast::ModuleItemOwner for Block {} | 2261 | impl ast::ModuleItemOwner for Block {} |
2159 | impl Block { | 2262 | impl Block { |
2160 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 2263 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
2161 | pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } | 2264 | pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } |
2162 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 2265 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
2163 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 2266 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
2164 | } | 2267 | } |
2268 | |||
2165 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2269 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2166 | pub struct ParamList { | 2270 | pub struct ParamList { |
2167 | pub(crate) syntax: SyntaxNode, | 2271 | pub(crate) syntax: SyntaxNode, |
@@ -2178,11 +2282,12 @@ impl AstNode for ParamList { | |||
2178 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2282 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2179 | } | 2283 | } |
2180 | impl ParamList { | 2284 | impl ParamList { |
2181 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 2285 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
2182 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } | 2286 | pub fn self_param(&self) -> Option<SelfParam> { support::child(&self.syntax) } |
2183 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } | 2287 | pub fn params(&self) -> AstChildren<Param> { support::children(&self.syntax) } |
2184 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 2288 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
2185 | } | 2289 | } |
2290 | |||
2186 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2291 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2187 | pub struct SelfParam { | 2292 | pub struct SelfParam { |
2188 | pub(crate) syntax: SyntaxNode, | 2293 | pub(crate) syntax: SyntaxNode, |
@@ -2201,10 +2306,14 @@ impl AstNode for SelfParam { | |||
2201 | impl ast::TypeAscriptionOwner for SelfParam {} | 2306 | impl ast::TypeAscriptionOwner for SelfParam {} |
2202 | impl ast::AttrsOwner for SelfParam {} | 2307 | impl ast::AttrsOwner for SelfParam {} |
2203 | impl SelfParam { | 2308 | impl SelfParam { |
2204 | pub fn amp_token(&self) -> Option<Amp> { support::token(&self.syntax) } | 2309 | pub fn amp_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![&]) } |
2205 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2310 | pub fn mut_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![mut]) } |
2206 | pub fn self_kw_token(&self) -> Option<SelfKw> { support::token(&self.syntax) } | 2311 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
2312 | support::token(&self.syntax, T![lifetime]) | ||
2313 | } | ||
2314 | pub fn self_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![self]) } | ||
2207 | } | 2315 | } |
2316 | |||
2208 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2317 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2209 | pub struct Param { | 2318 | pub struct Param { |
2210 | pub(crate) syntax: SyntaxNode, | 2319 | pub(crate) syntax: SyntaxNode, |
@@ -2224,8 +2333,9 @@ impl ast::TypeAscriptionOwner for Param {} | |||
2224 | impl ast::AttrsOwner for Param {} | 2333 | impl ast::AttrsOwner for Param {} |
2225 | impl Param { | 2334 | impl Param { |
2226 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } | 2335 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
2227 | pub fn dotdotdot_token(&self) -> Option<Dotdotdot> { support::token(&self.syntax) } | 2336 | pub fn dotdotdot_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![...]) } |
2228 | } | 2337 | } |
2338 | |||
2229 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2339 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2230 | pub struct UseItem { | 2340 | pub struct UseItem { |
2231 | pub(crate) syntax: SyntaxNode, | 2341 | pub(crate) syntax: SyntaxNode, |
@@ -2244,9 +2354,10 @@ impl AstNode for UseItem { | |||
2244 | impl ast::AttrsOwner for UseItem {} | 2354 | impl ast::AttrsOwner for UseItem {} |
2245 | impl ast::VisibilityOwner for UseItem {} | 2355 | impl ast::VisibilityOwner for UseItem {} |
2246 | impl UseItem { | 2356 | impl UseItem { |
2247 | pub fn use_kw_token(&self) -> Option<UseKw> { support::token(&self.syntax) } | 2357 | pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) } |
2248 | pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) } | 2358 | pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) } |
2249 | } | 2359 | } |
2360 | |||
2250 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2361 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2251 | pub struct UseTree { | 2362 | pub struct UseTree { |
2252 | pub(crate) syntax: SyntaxNode, | 2363 | pub(crate) syntax: SyntaxNode, |
@@ -2264,10 +2375,11 @@ impl AstNode for UseTree { | |||
2264 | } | 2375 | } |
2265 | impl UseTree { | 2376 | impl UseTree { |
2266 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 2377 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
2267 | pub fn star_token(&self) -> Option<Star> { support::token(&self.syntax) } | 2378 | pub fn star_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![*]) } |
2268 | pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) } | 2379 | pub fn use_tree_list(&self) -> Option<UseTreeList> { support::child(&self.syntax) } |
2269 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } | 2380 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } |
2270 | } | 2381 | } |
2382 | |||
2271 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2383 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2272 | pub struct Alias { | 2384 | pub struct Alias { |
2273 | pub(crate) syntax: SyntaxNode, | 2385 | pub(crate) syntax: SyntaxNode, |
@@ -2285,8 +2397,9 @@ impl AstNode for Alias { | |||
2285 | } | 2397 | } |
2286 | impl ast::NameOwner for Alias {} | 2398 | impl ast::NameOwner for Alias {} |
2287 | impl Alias { | 2399 | impl Alias { |
2288 | pub fn as_kw_token(&self) -> Option<AsKw> { support::token(&self.syntax) } | 2400 | pub fn as_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![as]) } |
2289 | } | 2401 | } |
2402 | |||
2290 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2403 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2291 | pub struct UseTreeList { | 2404 | pub struct UseTreeList { |
2292 | pub(crate) syntax: SyntaxNode, | 2405 | pub(crate) syntax: SyntaxNode, |
@@ -2303,10 +2416,11 @@ impl AstNode for UseTreeList { | |||
2303 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2416 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2304 | } | 2417 | } |
2305 | impl UseTreeList { | 2418 | impl UseTreeList { |
2306 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 2419 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
2307 | pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) } | 2420 | pub fn use_trees(&self) -> AstChildren<UseTree> { support::children(&self.syntax) } |
2308 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 2421 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
2309 | } | 2422 | } |
2423 | |||
2310 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2424 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2311 | pub struct ExternCrateItem { | 2425 | pub struct ExternCrateItem { |
2312 | pub(crate) syntax: SyntaxNode, | 2426 | pub(crate) syntax: SyntaxNode, |
@@ -2325,11 +2439,12 @@ impl AstNode for ExternCrateItem { | |||
2325 | impl ast::AttrsOwner for ExternCrateItem {} | 2439 | impl ast::AttrsOwner for ExternCrateItem {} |
2326 | impl ast::VisibilityOwner for ExternCrateItem {} | 2440 | impl ast::VisibilityOwner for ExternCrateItem {} |
2327 | impl ExternCrateItem { | 2441 | impl ExternCrateItem { |
2328 | pub fn extern_kw_token(&self) -> Option<ExternKw> { support::token(&self.syntax) } | 2442 | pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) } |
2329 | pub fn crate_kw_token(&self) -> Option<CrateKw> { support::token(&self.syntax) } | 2443 | pub fn crate_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![crate]) } |
2330 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 2444 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
2331 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } | 2445 | pub fn alias(&self) -> Option<Alias> { support::child(&self.syntax) } |
2332 | } | 2446 | } |
2447 | |||
2333 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2448 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2334 | pub struct ArgList { | 2449 | pub struct ArgList { |
2335 | pub(crate) syntax: SyntaxNode, | 2450 | pub(crate) syntax: SyntaxNode, |
@@ -2346,10 +2461,11 @@ impl AstNode for ArgList { | |||
2346 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2461 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2347 | } | 2462 | } |
2348 | impl ArgList { | 2463 | impl ArgList { |
2349 | pub fn l_paren_token(&self) -> Option<LParen> { support::token(&self.syntax) } | 2464 | pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) } |
2350 | pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) } | 2465 | pub fn args(&self) -> AstChildren<Expr> { support::children(&self.syntax) } |
2351 | pub fn r_paren_token(&self) -> Option<RParen> { support::token(&self.syntax) } | 2466 | pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) } |
2352 | } | 2467 | } |
2468 | |||
2353 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2469 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2354 | pub struct Path { | 2470 | pub struct Path { |
2355 | pub(crate) syntax: SyntaxNode, | 2471 | pub(crate) syntax: SyntaxNode, |
@@ -2369,6 +2485,7 @@ impl Path { | |||
2369 | pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) } | 2485 | pub fn segment(&self) -> Option<PathSegment> { support::child(&self.syntax) } |
2370 | pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) } | 2486 | pub fn qualifier(&self) -> Option<Path> { support::child(&self.syntax) } |
2371 | } | 2487 | } |
2488 | |||
2372 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2489 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2373 | pub struct PathSegment { | 2490 | pub struct PathSegment { |
2374 | pub(crate) syntax: SyntaxNode, | 2491 | pub(crate) syntax: SyntaxNode, |
@@ -2385,15 +2502,16 @@ impl AstNode for PathSegment { | |||
2385 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2502 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2386 | } | 2503 | } |
2387 | impl PathSegment { | 2504 | impl PathSegment { |
2388 | pub fn coloncolon_token(&self) -> Option<Coloncolon> { support::token(&self.syntax) } | 2505 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } |
2389 | pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) } | 2506 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } |
2390 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 2507 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
2391 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } | 2508 | pub fn type_arg_list(&self) -> Option<TypeArgList> { support::child(&self.syntax) } |
2392 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } | 2509 | pub fn param_list(&self) -> Option<ParamList> { support::child(&self.syntax) } |
2393 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } | 2510 | pub fn ret_type(&self) -> Option<RetType> { support::child(&self.syntax) } |
2394 | pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) } | 2511 | pub fn path_type(&self) -> Option<PathType> { support::child(&self.syntax) } |
2395 | pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) } | 2512 | pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) } |
2396 | } | 2513 | } |
2514 | |||
2397 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2515 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2398 | pub struct TypeArgList { | 2516 | pub struct TypeArgList { |
2399 | pub(crate) syntax: SyntaxNode, | 2517 | pub(crate) syntax: SyntaxNode, |
@@ -2410,15 +2528,16 @@ impl AstNode for TypeArgList { | |||
2410 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2528 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2411 | } | 2529 | } |
2412 | impl TypeArgList { | 2530 | impl TypeArgList { |
2413 | pub fn coloncolon_token(&self) -> Option<Coloncolon> { support::token(&self.syntax) } | 2531 | pub fn coloncolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![::]) } |
2414 | pub fn l_angle_token(&self) -> Option<LAngle> { support::token(&self.syntax) } | 2532 | pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } |
2415 | pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) } | 2533 | pub fn generic_args(&self) -> AstChildren<GenericArg> { support::children(&self.syntax) } |
2416 | pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) } | 2534 | pub fn type_args(&self) -> AstChildren<TypeArg> { support::children(&self.syntax) } |
2417 | pub fn lifetime_args(&self) -> AstChildren<LifetimeArg> { support::children(&self.syntax) } | 2535 | pub fn lifetime_args(&self) -> AstChildren<LifetimeArg> { support::children(&self.syntax) } |
2418 | pub fn assoc_type_args(&self) -> AstChildren<AssocTypeArg> { support::children(&self.syntax) } | 2536 | pub fn assoc_type_args(&self) -> AstChildren<AssocTypeArg> { support::children(&self.syntax) } |
2419 | pub fn const_args(&self) -> AstChildren<ConstArg> { support::children(&self.syntax) } | 2537 | pub fn const_args(&self) -> AstChildren<ConstArg> { support::children(&self.syntax) } |
2420 | pub fn r_angle_token(&self) -> Option<RAngle> { support::token(&self.syntax) } | 2538 | pub fn r_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![>]) } |
2421 | } | 2539 | } |
2540 | |||
2422 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2541 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2423 | pub struct TypeArg { | 2542 | pub struct TypeArg { |
2424 | pub(crate) syntax: SyntaxNode, | 2543 | pub(crate) syntax: SyntaxNode, |
@@ -2437,6 +2556,7 @@ impl AstNode for TypeArg { | |||
2437 | impl TypeArg { | 2556 | impl TypeArg { |
2438 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2557 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
2439 | } | 2558 | } |
2559 | |||
2440 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2560 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2441 | pub struct AssocTypeArg { | 2561 | pub struct AssocTypeArg { |
2442 | pub(crate) syntax: SyntaxNode, | 2562 | pub(crate) syntax: SyntaxNode, |
@@ -2455,9 +2575,10 @@ impl AstNode for AssocTypeArg { | |||
2455 | impl ast::TypeBoundsOwner for AssocTypeArg {} | 2575 | impl ast::TypeBoundsOwner for AssocTypeArg {} |
2456 | impl AssocTypeArg { | 2576 | impl AssocTypeArg { |
2457 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } | 2577 | pub fn name_ref(&self) -> Option<NameRef> { support::child(&self.syntax) } |
2458 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2578 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2459 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } | 2579 | pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } |
2460 | } | 2580 | } |
2581 | |||
2461 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2582 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2462 | pub struct LifetimeArg { | 2583 | pub struct LifetimeArg { |
2463 | pub(crate) syntax: SyntaxNode, | 2584 | pub(crate) syntax: SyntaxNode, |
@@ -2474,8 +2595,11 @@ impl AstNode for LifetimeArg { | |||
2474 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2595 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2475 | } | 2596 | } |
2476 | impl LifetimeArg { | 2597 | impl LifetimeArg { |
2477 | pub fn lifetime_token(&self) -> Option<Lifetime> { support::token(&self.syntax) } | 2598 | pub fn lifetime_token(&self) -> Option<SyntaxToken> { |
2599 | support::token(&self.syntax, T![lifetime]) | ||
2600 | } | ||
2478 | } | 2601 | } |
2602 | |||
2479 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2603 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2480 | pub struct ConstArg { | 2604 | pub struct ConstArg { |
2481 | pub(crate) syntax: SyntaxNode, | 2605 | pub(crate) syntax: SyntaxNode, |
@@ -2493,9 +2617,10 @@ impl AstNode for ConstArg { | |||
2493 | } | 2617 | } |
2494 | impl ConstArg { | 2618 | impl ConstArg { |
2495 | pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) } | 2619 | pub fn literal(&self) -> Option<Literal> { support::child(&self.syntax) } |
2496 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2620 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2497 | pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) } | 2621 | pub fn block_expr(&self) -> Option<BlockExpr> { support::child(&self.syntax) } |
2498 | } | 2622 | } |
2623 | |||
2499 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2624 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2500 | pub struct MacroItems { | 2625 | pub struct MacroItems { |
2501 | pub(crate) syntax: SyntaxNode, | 2626 | pub(crate) syntax: SyntaxNode, |
@@ -2512,8 +2637,8 @@ impl AstNode for MacroItems { | |||
2512 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2637 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2513 | } | 2638 | } |
2514 | impl ast::ModuleItemOwner for MacroItems {} | 2639 | impl ast::ModuleItemOwner for MacroItems {} |
2515 | impl ast::FnDefOwner for MacroItems {} | ||
2516 | impl MacroItems {} | 2640 | impl MacroItems {} |
2641 | |||
2517 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2642 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2518 | pub struct MacroStmts { | 2643 | pub struct MacroStmts { |
2519 | pub(crate) syntax: SyntaxNode, | 2644 | pub(crate) syntax: SyntaxNode, |
@@ -2533,6 +2658,7 @@ impl MacroStmts { | |||
2533 | pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } | 2658 | pub fn statements(&self) -> AstChildren<Stmt> { support::children(&self.syntax) } |
2534 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } | 2659 | pub fn expr(&self) -> Option<Expr> { support::child(&self.syntax) } |
2535 | } | 2660 | } |
2661 | |||
2536 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2662 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2537 | pub struct ExternItemList { | 2663 | pub struct ExternItemList { |
2538 | pub(crate) syntax: SyntaxNode, | 2664 | pub(crate) syntax: SyntaxNode, |
@@ -2548,13 +2674,13 @@ impl AstNode for ExternItemList { | |||
2548 | } | 2674 | } |
2549 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2675 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2550 | } | 2676 | } |
2551 | impl ast::FnDefOwner for ExternItemList {} | ||
2552 | impl ast::ModuleItemOwner for ExternItemList {} | 2677 | impl ast::ModuleItemOwner for ExternItemList {} |
2553 | impl ExternItemList { | 2678 | impl ExternItemList { |
2554 | pub fn l_curly_token(&self) -> Option<LCurly> { support::token(&self.syntax) } | 2679 | pub fn l_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['{']) } |
2555 | pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) } | 2680 | pub fn extern_items(&self) -> AstChildren<ExternItem> { support::children(&self.syntax) } |
2556 | pub fn r_curly_token(&self) -> Option<RCurly> { support::token(&self.syntax) } | 2681 | pub fn r_curly_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['}']) } |
2557 | } | 2682 | } |
2683 | |||
2558 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2684 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2559 | pub struct ExternBlock { | 2685 | pub struct ExternBlock { |
2560 | pub(crate) syntax: SyntaxNode, | 2686 | pub(crate) syntax: SyntaxNode, |
@@ -2574,6 +2700,7 @@ impl ExternBlock { | |||
2574 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } | 2700 | pub fn abi(&self) -> Option<Abi> { support::child(&self.syntax) } |
2575 | pub fn extern_item_list(&self) -> Option<ExternItemList> { support::child(&self.syntax) } | 2701 | pub fn extern_item_list(&self) -> Option<ExternItemList> { support::child(&self.syntax) } |
2576 | } | 2702 | } |
2703 | |||
2577 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2704 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2578 | pub struct MetaItem { | 2705 | pub struct MetaItem { |
2579 | pub(crate) syntax: SyntaxNode, | 2706 | pub(crate) syntax: SyntaxNode, |
@@ -2591,10 +2718,11 @@ impl AstNode for MetaItem { | |||
2591 | } | 2718 | } |
2592 | impl MetaItem { | 2719 | impl MetaItem { |
2593 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 2720 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } |
2594 | pub fn eq_token(&self) -> Option<Eq> { support::token(&self.syntax) } | 2721 | pub fn eq_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![=]) } |
2595 | pub fn attr_input(&self) -> Option<AttrInput> { support::child(&self.syntax) } | 2722 | pub fn attr_input(&self) -> Option<AttrInput> { support::child(&self.syntax) } |
2596 | pub fn nested_meta_items(&self) -> AstChildren<MetaItem> { support::children(&self.syntax) } | 2723 | pub fn nested_meta_items(&self) -> AstChildren<MetaItem> { support::children(&self.syntax) } |
2597 | } | 2724 | } |
2725 | |||
2598 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2726 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2599 | pub struct MacroDef { | 2727 | pub struct MacroDef { |
2600 | pub(crate) syntax: SyntaxNode, | 2728 | pub(crate) syntax: SyntaxNode, |
@@ -2614,6 +2742,7 @@ impl MacroDef { | |||
2614 | pub fn name(&self) -> Option<Name> { support::child(&self.syntax) } | 2742 | pub fn name(&self) -> Option<Name> { support::child(&self.syntax) } |
2615 | pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) } | 2743 | pub fn token_tree(&self) -> Option<TokenTree> { support::child(&self.syntax) } |
2616 | } | 2744 | } |
2745 | |||
2617 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2746 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2618 | pub enum NominalDef { | 2747 | pub enum NominalDef { |
2619 | StructDef(StructDef), | 2748 | StructDef(StructDef), |
@@ -2656,6 +2785,7 @@ impl AstNode for NominalDef { | |||
2656 | impl ast::NameOwner for NominalDef {} | 2785 | impl ast::NameOwner for NominalDef {} |
2657 | impl ast::TypeParamsOwner for NominalDef {} | 2786 | impl ast::TypeParamsOwner for NominalDef {} |
2658 | impl ast::AttrsOwner for NominalDef {} | 2787 | impl ast::AttrsOwner for NominalDef {} |
2788 | |||
2659 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2789 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2660 | pub enum GenericParam { | 2790 | pub enum GenericParam { |
2661 | LifetimeParam(LifetimeParam), | 2791 | LifetimeParam(LifetimeParam), |
@@ -2695,6 +2825,7 @@ impl AstNode for GenericParam { | |||
2695 | } | 2825 | } |
2696 | } | 2826 | } |
2697 | } | 2827 | } |
2828 | |||
2698 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2829 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2699 | pub enum GenericArg { | 2830 | pub enum GenericArg { |
2700 | LifetimeArg(LifetimeArg), | 2831 | LifetimeArg(LifetimeArg), |
@@ -2740,6 +2871,7 @@ impl AstNode for GenericArg { | |||
2740 | } | 2871 | } |
2741 | } | 2872 | } |
2742 | } | 2873 | } |
2874 | |||
2743 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2875 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2744 | pub enum TypeRef { | 2876 | pub enum TypeRef { |
2745 | ParenType(ParenType), | 2877 | ParenType(ParenType), |
@@ -2841,6 +2973,7 @@ impl AstNode for TypeRef { | |||
2841 | } | 2973 | } |
2842 | } | 2974 | } |
2843 | } | 2975 | } |
2976 | |||
2844 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 2977 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2845 | pub enum ModuleItem { | 2978 | pub enum ModuleItem { |
2846 | StructDef(StructDef), | 2979 | StructDef(StructDef), |
@@ -2951,6 +3084,7 @@ impl AstNode for ModuleItem { | |||
2951 | impl ast::NameOwner for ModuleItem {} | 3084 | impl ast::NameOwner for ModuleItem {} |
2952 | impl ast::AttrsOwner for ModuleItem {} | 3085 | impl ast::AttrsOwner for ModuleItem {} |
2953 | impl ast::VisibilityOwner for ModuleItem {} | 3086 | impl ast::VisibilityOwner for ModuleItem {} |
3087 | |||
2954 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3088 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2955 | pub enum ImplItem { | 3089 | pub enum ImplItem { |
2956 | FnDef(FnDef), | 3090 | FnDef(FnDef), |
@@ -2992,6 +3126,7 @@ impl AstNode for ImplItem { | |||
2992 | } | 3126 | } |
2993 | impl ast::NameOwner for ImplItem {} | 3127 | impl ast::NameOwner for ImplItem {} |
2994 | impl ast::AttrsOwner for ImplItem {} | 3128 | impl ast::AttrsOwner for ImplItem {} |
3129 | |||
2995 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3130 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
2996 | pub enum ExternItem { | 3131 | pub enum ExternItem { |
2997 | FnDef(FnDef), | 3132 | FnDef(FnDef), |
@@ -3028,6 +3163,7 @@ impl AstNode for ExternItem { | |||
3028 | impl ast::NameOwner for ExternItem {} | 3163 | impl ast::NameOwner for ExternItem {} |
3029 | impl ast::AttrsOwner for ExternItem {} | 3164 | impl ast::AttrsOwner for ExternItem {} |
3030 | impl ast::VisibilityOwner for ExternItem {} | 3165 | impl ast::VisibilityOwner for ExternItem {} |
3166 | |||
3031 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3167 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3032 | pub enum Expr { | 3168 | pub enum Expr { |
3033 | TupleExpr(TupleExpr), | 3169 | TupleExpr(TupleExpr), |
@@ -3241,6 +3377,7 @@ impl AstNode for Expr { | |||
3241 | } | 3377 | } |
3242 | } | 3378 | } |
3243 | impl ast::AttrsOwner for Expr {} | 3379 | impl ast::AttrsOwner for Expr {} |
3380 | |||
3244 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3381 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3245 | pub enum Pat { | 3382 | pub enum Pat { |
3246 | OrPat(OrPat), | 3383 | OrPat(OrPat), |
@@ -3354,6 +3491,7 @@ impl AstNode for Pat { | |||
3354 | } | 3491 | } |
3355 | } | 3492 | } |
3356 | } | 3493 | } |
3494 | |||
3357 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3495 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3358 | pub enum RecordInnerPat { | 3496 | pub enum RecordInnerPat { |
3359 | RecordFieldPat(RecordFieldPat), | 3497 | RecordFieldPat(RecordFieldPat), |
@@ -3387,6 +3525,7 @@ impl AstNode for RecordInnerPat { | |||
3387 | } | 3525 | } |
3388 | } | 3526 | } |
3389 | } | 3527 | } |
3528 | |||
3390 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3529 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3391 | pub enum AttrInput { | 3530 | pub enum AttrInput { |
3392 | Literal(Literal), | 3531 | Literal(Literal), |
@@ -3420,6 +3559,7 @@ impl AstNode for AttrInput { | |||
3420 | } | 3559 | } |
3421 | } | 3560 | } |
3422 | } | 3561 | } |
3562 | |||
3423 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3563 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3424 | pub enum Stmt { | 3564 | pub enum Stmt { |
3425 | LetStmt(LetStmt), | 3565 | LetStmt(LetStmt), |
@@ -3453,6 +3593,7 @@ impl AstNode for Stmt { | |||
3453 | } | 3593 | } |
3454 | } | 3594 | } |
3455 | } | 3595 | } |
3596 | |||
3456 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 3597 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
3457 | pub enum FieldDefList { | 3598 | pub enum FieldDefList { |
3458 | RecordFieldDefList(RecordFieldDefList), | 3599 | RecordFieldDefList(RecordFieldDefList), |