re-enabled space = play! but not pause

This commit is contained in:
🪞👃🪞 2025-01-14 22:25:18 +01:00
parent 0fb7655b53
commit 0ce0a07713
6 changed files with 110 additions and 41 deletions

View file

@ -17,7 +17,19 @@ use crate::*;
}
}
};
// Provide a value that may also be a numeric literal in the EDN
// Provide a value that may also be a numeric literal in the EDN, to a generic implementation.
(# $type:ty:|$self:ident:<$T:ident:$Trait:path>|{ $($pat:pat => $expr:expr),* $(,)? }) => {
impl<'a, $T: $Trait> EdnProvide<'a, $type> for $T {
fn get <S: AsRef<str>> (&'a $self, edn: &'a EdnItem<S>) -> Option<$type> {
Some(match edn.to_ref() {
$(EdnItem::Sym($pat) => $expr,)*
EdnItem::Num(n) => n as $type,
_ => return None
})
}
}
};
// Provide a value that may also be a numeric literal in the EDN, to a concrete implementation.
(# $type:ty:|$self:ident:$State:ty|{ $($pat:pat => $expr:expr),* $(,)? }) => {
impl<'a> EdnProvide<'a, $type> for $State {
fn get <S: AsRef<str>> (&'a $self, edn: &'a EdnItem<S>) -> Option<$type> {