mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 03:36:42 +01:00
core, input: add flex_trait
This commit is contained in:
parent
360b404b69
commit
8cbd7dd8e8
7 changed files with 201 additions and 98 deletions
|
|
@ -56,13 +56,13 @@ impl ViewDef {
|
|||
let builtins = builtins_with_boxes_output(quote! { #output })
|
||||
.map(|(builtin, builtin_ty)|match builtin {
|
||||
Single(name) => quote! {
|
||||
if dsl.exp_head()?.key()? == Some(#name) {
|
||||
if dsl.head()?.key()? == Some(#name) {
|
||||
return Ok(Some(#builtin_ty::from_dsl_or_else(self, dsl,
|
||||
||format!("failed to load builtin").into())?.boxed()))
|
||||
}
|
||||
},
|
||||
Prefix(name) => quote! {
|
||||
if let Some(key) = dsl.exp_head()?.key()? && key.starts_with(#name) {
|
||||
if let Some(key) = dsl.head()?.key()? && key.starts_with(#name) {
|
||||
return Ok(Some(#builtin_ty::from_dsl_or_else(self, dsl,
|
||||
||format!("failed to load builtin").into())?.boxed()))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue