diff options
Diffstat (limited to 'crates/libsyntax2/src/ast')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index 3e6c673ab..80670ce71 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs | |||
@@ -267,6 +267,31 @@ impl<R: TreeRoot> AstNode<R> for NeverType<R> { | |||
267 | 267 | ||
268 | impl<R: TreeRoot> NeverType<R> {} | 268 | impl<R: TreeRoot> NeverType<R> {} |
269 | 269 | ||
270 | // NominalDef | ||
271 | #[derive(Debug, Clone, Copy)] | ||
272 | pub enum NominalDef<R: TreeRoot = Arc<SyntaxRoot>> { | ||
273 | StructDef(StructDef<R>), | ||
274 | EnumDef(EnumDef<R>), | ||
275 | } | ||
276 | |||
277 | impl<R: TreeRoot> AstNode<R> for NominalDef<R> { | ||
278 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | ||
279 | match syntax.kind() { | ||
280 | STRUCT_DEF => Some(NominalDef::StructDef(StructDef { syntax })), | ||
281 | ENUM_DEF => Some(NominalDef::EnumDef(EnumDef { syntax })), | ||
282 | _ => None, | ||
283 | } | ||
284 | } | ||
285 | fn syntax(&self) -> &SyntaxNode<R> { | ||
286 | match self { | ||
287 | NominalDef::StructDef(inner) => inner.syntax(), | ||
288 | NominalDef::EnumDef(inner) => inner.syntax(), | ||
289 | } | ||
290 | } | ||
291 | } | ||
292 | |||
293 | impl<R: TreeRoot> NominalDef<R> {} | ||
294 | |||
270 | // ParenType | 295 | // ParenType |
271 | #[derive(Debug, Clone, Copy)] | 296 | #[derive(Debug, Clone, Copy)] |
272 | pub struct ParenType<R: TreeRoot = Arc<SyntaxRoot>> { | 297 | pub struct ParenType<R: TreeRoot = Arc<SyntaxRoot>> { |