core, input: add flex_trait

This commit is contained in:
🪞👃🪞 2025-07-29 14:17:01 +03:00
parent 360b404b69
commit 8cbd7dd8e8
7 changed files with 201 additions and 98 deletions

View file

@ -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()))
}