mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 03:36:42 +01:00
re foreign trait constraints
This commit is contained in:
parent
ddf0c05d5f
commit
cbd28a5934
10 changed files with 30 additions and 24 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue