mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
fix missing content
This commit is contained in:
parent
e62e36d558
commit
df50bb9f47
3 changed files with 22 additions and 10 deletions
|
|
@ -95,12 +95,24 @@ impl<'a, E: Output + 'a, T: EdnViewData<'a, E>> TryFromEdn<'a, T> for Bsp<E, Ren
|
||||||
fn try_from_edn (s: &'a T, head: &EdnItem<&str>, tail: &'a [EdnItem<&str>]) -> Option<Self> {
|
fn try_from_edn (s: &'a T, head: &EdnItem<&str>, tail: &'a [EdnItem<&str>]) -> Option<Self> {
|
||||||
use EdnItem::*;
|
use EdnItem::*;
|
||||||
Some(match (head, tail) {
|
Some(match (head, tail) {
|
||||||
(Key("bsp/n"), [a, b]) => Self::n(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
(Key("bsp/n"), [a, b]) => Self::n(
|
||||||
(Key("bsp/s"), [a, b]) => Self::s(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
s.get_content(a).expect("no a"),
|
||||||
(Key("bsp/e"), [a, b]) => Self::e(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
s.get_content(b).expect("no b")),
|
||||||
(Key("bsp/w"), [a, b]) => Self::w(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
(Key("bsp/s"), [a, b]) => Self::s(
|
||||||
(Key("bsp/a"), [a, b]) => Self::a(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
s.get_content(a).expect("no a"),
|
||||||
(Key("bsp/b"), [a, b]) => Self::b(s.get_content(a).expect("no a"), s.get(b).expect("no b")),
|
s.get_content(b).expect("no b")),
|
||||||
|
(Key("bsp/e"), [a, b]) => Self::e(
|
||||||
|
s.get_content(a).expect("no a"),
|
||||||
|
s.get_content(b).expect("no b")),
|
||||||
|
(Key("bsp/w"), [a, b]) => Self::w(
|
||||||
|
s.get_content(a).expect("no a"),
|
||||||
|
s.get_content(b).expect("no b")),
|
||||||
|
(Key("bsp/a"), [a, b]) => Self::a(
|
||||||
|
s.get_content(a).expect("no a"),
|
||||||
|
s.get_content(b).expect("no b")),
|
||||||
|
(Key("bsp/b"), [a, b]) => Self::b(
|
||||||
|
s.get_content(a).expect("no a"),
|
||||||
|
s.get_content(b).expect("no b")),
|
||||||
_ => return None
|
_ => return None
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ impl<'a, E: Output + 'a, T: EdnViewData<'a, E>> TryFromEdn<'a, T> for Either<E,
|
||||||
use EdnItem::*;
|
use EdnItem::*;
|
||||||
if let (Key("either"), [condition, content, alternative]) = (head, tail) {
|
if let (Key("either"), [condition, content, alternative]) = (head, tail) {
|
||||||
Some(Self::new(
|
Some(Self::new(
|
||||||
state.get(condition).expect("either: no condition"),
|
state.get_bool(condition).expect("either: no condition"),
|
||||||
state.get(content).expect("either: no content"),
|
state.get_content(content).expect("either: no content"),
|
||||||
state.get(alternative).expect("either: no alternative")
|
state.get_content(alternative).expect("either: no alternative")
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
(bsp/s :toolbar
|
(bsp/s (fixed/y 2 :toolbar)
|
||||||
(fill/x (align/c (bsp/w :pool
|
(fill/x (align/c (bsp/w :pool
|
||||||
(bsp/n :outputs (bsp/n :inputs (bsp/n :tracks :scenes)))))))
|
(bsp/n :outputs (bsp/n :inputs (bsp/n :tracks :scenes)))))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue