dsl: Provide -> Take, Receive -> Give (swap + shorten)

This commit is contained in:
🪞👃🪞 2025-05-23 21:39:29 +03:00
parent 583660c330
commit ddf0c05d5f
10 changed files with 64 additions and 55 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: Provide::provide_or_fail(self, words)?,
#arg: Take::provide_or_fail(self, words)?,
});
}
out
@ -149,7 +149,7 @@ impl ToTokens for CommandDef {
}
}
/// Generated by [tengri_proc::command].
impl<'n> ::tengri::dsl::Provide<'n, #state> for #command_enum {
impl<'n> ::tengri::dsl::Take<'n, #state> for #command_enum {
fn provide <'source> (
state: &#state,
words: &mut ::tengri::dsl::TokenIter<'source>