dsl: refactor with eyes closed
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-08-22 03:00:36 +03:00
parent 1ef898ac32
commit 2557a0d253
7 changed files with 605 additions and 342 deletions

View file

@ -96,17 +96,18 @@ impl ExposeImpl {
}
}
} else if is_num(&type_is) {
quote! {
/// Generated by [tengri_proc::expose].
impl ::tengri::dsl::FromDsl<#state> for #t {
fn from_dsl (state: &#state, dsl: &impl Dsl) -> Perhaps<Self> {
match dsl.num()? {
Some(n) => Ok(Some(n.parse::<#t>()?)),
_ => match dsl.word()? { #(#variants)* _ => Ok(None) }
}
}
}
}
quote! {}
//quote! {
///// Generated by [tengri_proc::expose].
//impl ::tengri::dsl::FromDsl<#state> for #t {
//fn from_dsl (state: &#state, dsl: &impl Dsl) -> Perhaps<Self> {
//match dsl.num()? {
//Some(n) => Ok(Some(n.parse::<#t>()?)),
//_ => match dsl.word()? { #(#variants)* _ => Ok(None) }
//}
//}
//}
//}
} else {
quote! {
/// Generated by [tengri_proc::expose].