mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-07 12:16:44 +01:00
parent
ca4c558eab
commit
e72225f83c
11 changed files with 421 additions and 574 deletions
|
|
@ -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) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue