mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 03:36:42 +01:00
This commit is contained in:
parent
1ef898ac32
commit
2557a0d253
7 changed files with 605 additions and 342 deletions
|
|
@ -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].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue