proc: auto implement Context on command target

Context and TryFromDsl overlap
This commit is contained in:
🪞👃🪞 2025-05-09 21:13:46 +03:00
parent 3bb38f2d27
commit 20ccff13de
5 changed files with 17 additions and 13 deletions

View file

@ -29,7 +29,7 @@ impl<'state, S, C: DslCommand<'state, S>, I: DslInput> KeyMap<'state, S, C, I> f
match exp_iter.next() {
Some(Token { value: Value::Sym(binding), .. }) => {
if input.matches_dsl(binding) {
if let Some(command) = C::try_from_expr(state, exp_iter.clone()) {
if let Some(command) = C::try_from_expr(state, &mut exp_iter) {
return Some(command)
}
}
@ -55,7 +55,7 @@ impl<'state, S, C: DslCommand<'state, S>, I: DslInput> KeyMap<'state, S, C, I> f
match exp_iter.next() {
Some(Token { value: Value::Sym(binding), .. }) => {
if input.matches_dsl(binding) {
if let Some(command) = C::try_from_expr(state, exp_iter.clone()) {
if let Some(command) = C::try_from_expr(state, &mut exp_iter) {
return Some(command)
}
}