mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
this one at least compiles
This commit is contained in:
parent
a145e332de
commit
291b917970
7 changed files with 416 additions and 198 deletions
|
|
@ -81,7 +81,7 @@ impl ExposeImpl {
|
|||
/// Generated by [tengri_proc::expose].
|
||||
impl ::tengri::dsl::FromDsl<#state> for #t {
|
||||
fn try_from_dsl (state: &#state, dsl: &impl Dsl) -> Perhaps<Self> {
|
||||
Ok(Some(match dsl.val() {
|
||||
Ok(Some(match dsl.dsl() {
|
||||
#arms
|
||||
_ => { return Ok(None) }
|
||||
}))
|
||||
|
|
@ -93,7 +93,7 @@ impl ExposeImpl {
|
|||
let formatted_type = format!("{}", quote! { #t });
|
||||
if &formatted_type == "bool" {
|
||||
return quote! {
|
||||
::tengri::dsl::DslVal::Sym(s) => match s.as_ref() {
|
||||
::tengri::dsl::Val::Sym(s) => match s.as_ref() {
|
||||
":true" => true,
|
||||
":false" => false,
|
||||
#variants
|
||||
|
|
@ -110,16 +110,16 @@ impl ExposeImpl {
|
|||
Span::call_site()
|
||||
);
|
||||
return quote! {
|
||||
::tengri::dsl::DslVal::Num(n) => TryInto::<#t>::try_into(n)
|
||||
::tengri::dsl::Val::Num(n) => TryInto::<#t>::try_into(n)
|
||||
.unwrap_or_else(|_|panic!(#num_err)),
|
||||
::tengri::dsl::DslVal::Sym(s) => match s.as_ref() {
|
||||
::tengri::dsl::Val::Sym(s) => match s.as_ref() {
|
||||
#variants
|
||||
_ => { return Ok(None) }
|
||||
},
|
||||
}
|
||||
}
|
||||
return quote! {
|
||||
::tengri::dsl::DslVal::Sym(s) => match s.as_ref() {
|
||||
::tengri::dsl::Val::Sym(s) => match s.as_ref() {
|
||||
#variants
|
||||
_ => { return Ok(None) }
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue