diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index 795e5d0a5506a..b68bed7b96675 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs ec9ec5e218af9a6b449b40f716e00bbe23c2777941d105b9ed68071aa2468ca2 ec9ec5e218af9a6b449b40f716e00bbe23c2777941d105b9ed68071aa2468ca2 +top.rs 6ebb6a7d13c46a9d330f2a4d9851e5bbca800b305d0633e1fad6ea8d0f4839e6 6ebb6a7d13c46a9d330f2a4d9851e5bbca800b305d0633e1fad6ea8d0f4839e6 diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index 397120818723e..81e5e08c759d7 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -78,7 +78,17 @@ impl From> for trap::Label { #[derive(Debug)] pub struct Missing { - _unused: () + pub id: trap::TrapId, +} + +impl trap::TrapEntry for Missing { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("missings", vec![id.into()]); + } } impl trap::TrapClass for Missing { @@ -105,7 +115,17 @@ impl From> for trap::Label { #[derive(Debug)] pub struct Unimplemented { - _unused: () + pub id: trap::TrapId, +} + +impl trap::TrapEntry for Unimplemented { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("unimplementeds", vec![id.into()]); + } } impl trap::TrapClass for Unimplemented { @@ -131,35 +151,45 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct Declaration { - _unused: () +pub struct Abi { + pub id: trap::TrapId, +} + +impl trap::TrapEntry for Abi { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("abis", vec![id.into()]); + } } -impl trap::TrapClass for Declaration { - fn class_name() -> &'static str { "Declaration" } +impl trap::TrapClass for Abi { + fn class_name() -> &'static str { "Abi" } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Declaration is a subclass of AstNode +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Abi is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Declaration is a subclass of Element +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Abi is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Declaration is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Abi is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } @@ -167,35 +197,35 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct Expr { +pub struct Adt { _unused: () } -impl trap::TrapClass for Expr { - fn class_name() -> &'static str { "Expr" } +impl trap::TrapClass for Adt { + fn class_name() -> &'static str { "Adt" } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Expr is a subclass of AstNode +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Expr is a subclass of Element +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme Expr is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme Adt is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } @@ -203,63 +233,49 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct GenericArgList { - pub id: trap::TrapId, +pub struct ArgList { + pub id: trap::TrapId, + pub args: Vec>, } -impl trap::TrapEntry for GenericArgList { +impl trap::TrapEntry for ArgList { fn extract_id(&mut self) -> trap::TrapId { std::mem::replace(&mut self.id, trap::TrapId::Star) } fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("generic_arg_lists", vec![id.into()]); - } -} - -impl trap::TrapClass for GenericArgList { - fn class_name() -> &'static str { "GenericArgList" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme GenericArgList is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) + out.add_tuple("arg_lists", vec![id.into()]); + for (i, v) in self.args.into_iter().enumerate() { + out.add_tuple("arg_list_args", vec![id.into(), i.into(), v.into()]); } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme GenericArgList is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } +impl trap::TrapClass for ArgList { + fn class_name() -> &'static str { "ArgList" } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme GenericArgList is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ArgList is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme GenericArgList is a subclass of Unextracted +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ArgList is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme GenericArgList is a subclass of Unimplemented +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme ArgList is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } @@ -267,46 +283,35 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct Label { - pub id: trap::TrapId