mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
re-enabled space = play! but not pause
This commit is contained in:
parent
0fb7655b53
commit
0ce0a07713
6 changed files with 110 additions and 41 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue