dsl: auto-impl the obvious one (hopefully)
Some checks are pending
/ build (push) Waiting to run

re foreign trait constraints
This commit is contained in:
🪞👃🪞 2025-05-23 21:47:18 +03:00
parent ddf0c05d5f
commit cbd28a5934
10 changed files with 30 additions and 24 deletions

View file

@ -84,7 +84,7 @@ impl ToTokens for CommandDef {
let mut out = TokenStream2::new();
for (arg, ty) in arm.args() {
write_quote_to(&mut out, quote! {
#arg: Take::provide_or_fail(self, words)?,
#arg: Take::take_or_fail(self, words)?,
});
}
out
@ -150,7 +150,7 @@ impl ToTokens for CommandDef {
}
/// Generated by [tengri_proc::command].
impl<'n> ::tengri::dsl::Take<'n, #state> for #command_enum {
fn provide <'source> (
fn take <'source> (
state: &#state,
words: &mut ::tengri::dsl::TokenIter<'source>
) -> Perhaps<Self> {

View file

@ -86,7 +86,7 @@ impl ToTokens for ExposeImpl {
write_quote_to(out, quote! {
/// Generated by [tengri_proc::expose].
impl<'n> ::tengri::dsl::Take<'n, #state> for #t {
fn provide <'source> (
fn take <'source> (
state: &#state,
words: &mut ::tengri::dsl::TokenIter<'source>
) -> Perhaps<Self> {

View file

@ -77,7 +77,7 @@ impl ToTokens for ViewDef {
#(#builtins)*
None
},
// Symbols are handled by user-provided functions
// Symbols are handled by user-taked functions
// that take no parameters but `&self`.
::tengri::dsl::Value::Sym(sym) => match sym {
#(#exposed)*
@ -100,7 +100,7 @@ impl ToTokens for ViewDef {
#self_ty::view(self)
}
}
// Original user-provided implementation:
// Original user-taked implementation:
#block
})
}