mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-09-18 13:26:42 +02:00
update signatures of layout modifiers
This commit is contained in:
parent
e69d4287e0
commit
41ef62146b
6 changed files with 18 additions and 18 deletions
|
|
@ -1,9 +1,9 @@
|
|||
use crate::*;
|
||||
|
||||
fn_kw_layout!(kw_when |state, output, expr| {
|
||||
let thunk = draw(move|screen|ok_flat(expr.nth(2)?.map(|x: &'a str|state.interpret(screen, x))));
|
||||
let thunk = draw(move|screen|ok_flat(expr.nth(2)?.map(|x|state.interpret(screen, x))));
|
||||
ok_flat(matches!(expr.head()?, Some("when")).then(||{
|
||||
when(state.namespace(&expr.nth(1)?)?.unwrap(), thunk) .draw(output)
|
||||
when(state.namespace(&expr.nth(1)?)?.unwrap(), thunk).draw(output)
|
||||
}))
|
||||
});
|
||||
|
||||
|
|
@ -19,8 +19,8 @@ pub const fn when <'a, T: Screen> (condition: bool, item: impl Draw<'a, T>) -> i
|
|||
}
|
||||
|
||||
fn_kw_layout!(kw_either |state, output, expr| {
|
||||
let thunk_a = draw(move|screen|ok_flat(expr.nth(2)?.map(|x: &'a str|state.interpret(screen, x))));
|
||||
let thunk_b = draw(move|screen|ok_flat(expr.nth(3)?.map(|x: &'a str|state.interpret(screen, x))));
|
||||
let thunk_a = draw(move|screen|ok_flat(expr.nth(2)?.map(|x|state.interpret(screen, x))));
|
||||
let thunk_b = draw(move|screen|ok_flat(expr.nth(3)?.map(|x|state.interpret(screen, x))));
|
||||
ok_flat(matches!(expr.head()?, Some("either")).then(||{
|
||||
either(state.namespace(&expr.nth(1)?)?.unwrap(), thunk_a, thunk_b).draw(output)
|
||||
}))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue