mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
separate render/content macros; add has_jack
This commit is contained in:
parent
08184f9906
commit
e62e36d558
19 changed files with 183 additions and 226 deletions
|
|
@ -1,4 +1,8 @@
|
|||
use crate::*;
|
||||
/// Turns an EDN item sequence into a command enum variant.
|
||||
pub trait EdnCommand<C>: Command<C> {
|
||||
fn from_edn <'a> (state: &C, head: &EdnItem<&str>, tail: &'a [EdnItem<String>]) -> Self;
|
||||
}
|
||||
/** Implement `EdnCommand` for given `State` and `Command` */
|
||||
#[macro_export] macro_rules! edn_command {
|
||||
($Command:ty : |$state:ident:$State:ty| { $((
|
||||
|
|
@ -47,16 +51,3 @@ use crate::*;
|
|||
let $arg: $type = EdnProvide::<$type>::get_or_fail($state, $arg);
|
||||
};
|
||||
}
|
||||
/// Turns an EDN symbol sequence into a command enum variant.
|
||||
pub trait EdnCommand<C>: Command<C> {
|
||||
fn from_edn <'a> (state: &C, head: &EdnItem<&str>, tail: &'a [EdnItem<String>]) -> Self;
|
||||
fn get_isize (state: &C, item: &EdnItem<&str>) -> Option<isize> {
|
||||
None
|
||||
}
|
||||
fn get_usize (state: &C, item: &EdnItem<&str>) -> Option<usize> {
|
||||
None
|
||||
}
|
||||
fn get_bool (state: &C, item: &EdnItem<&str>) -> Option<usize> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
use crate::*;
|
||||
use EdnItem::*;
|
||||
|
||||
pub trait EdnInput: Input {
|
||||
fn matches (&self, token: &str) -> bool;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue