wip: updating tests
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-06-12 21:17:08 +03:00
parent 21832453d9
commit 17506726cb
36 changed files with 280 additions and 271 deletions

View file

@ -45,7 +45,7 @@ impl ToTokens for ViewDef {
// that operate over constants and symbols.
let builtin = builtins_with_boxes_output(quote! { #output }).map(|builtin|quote! {
::tengri::dsl::Value::Exp(_, expr) => return Ok(Some(
#builtin::take_or_fail(state, expr, ||"failed to load builtin")?.boxed()
#builtin::try_provide(state, expr, ||"failed to load builtin")?.boxed()
)),
});
// Symbols are handled by user-taked functions
@ -63,11 +63,8 @@ impl ToTokens for ViewDef {
/// Makes [#self_ty] able to construct the [Render]able
/// which might correspond to a given [TokenStream],
/// while taking [#self_ty]'s state into consideration.
impl<'source, 'state: 'source>
Take<'state, 'source, #self_ty>
for Box<dyn Render<#output> + 'state>
{
fn take (state: &'state #self_ty, mut words: Cst<'source>) -> Perhaps<Self> {
impl<'state> ::tengri::dsl::Dsl<Box<dyn Render<#output> + 'state>> for #self_ty {
fn try_provide (state: &'state #self_ty, mut words: ::tengri::dsl::Ast) -> Perhaps<Box<dyn Render<#output> + 'state>> {
Ok(if let Some(::tengri::dsl::Token { value, .. }) = words.peek() {
match value { #(#builtin)* #(#exposed)* _ => None }
} else {