wip: fix dsl
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
🪞👃🪞 2025-07-16 00:10:03 +03:00
parent ca4c558eab
commit e72225f83c
11 changed files with 421 additions and 574 deletions

View file

@ -57,7 +57,6 @@ impl ToTokens for ExposeDef {
impl ToTokens for ExposeImpl {
fn to_tokens (&self, out: &mut TokenStream2) {
let Self(block, exposed) = self;
let state = &block.self_ty;
write_quote_to(out, quote! { #block });
for (t, variants) in exposed.iter() {
self.expose_variants(out, t, variants);
@ -80,8 +79,8 @@ impl ExposeImpl {
let arms = Self::with_predefined(t, quote! { #(#arms)* });
write_quote_to(out, quote! {
/// Generated by [tengri_proc::expose].
impl ::tengri::dsl::DslFrom<#state> for #t {
fn try_dsl_from (state: &#state, dsl: &impl Dsl) -> Perhaps<Self> {
impl ::tengri::dsl::FromDsl<#state> for #t {
fn try_from_dsl (state: &#state, dsl: &impl Dsl) -> Perhaps<Self> {
Ok(Some(match dsl.val() {
#arms
_ => { return Ok(None) }