mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
fix(output): fix cond
This commit is contained in:
parent
c9f0164871
commit
b127526570
1 changed files with 6 additions and 8 deletions
|
|
@ -36,15 +36,13 @@ try_from_expr!(<'source, 'state, E>: When<RenderBox<'state, E>>: |state, iter| {
|
||||||
try_from_expr!(<'source, 'state, E>: Either<RenderBox<'state, E>, RenderBox<'state, E>>: |state, iter| {
|
try_from_expr!(<'source, 'state, E>: Either<RenderBox<'state, E>, RenderBox<'state, E>>: |state, iter| {
|
||||||
if let Some(Token { value: Value::Key("either"), .. }) = iter.peek() {
|
if let Some(Token { value: Value::Key("either"), .. }) = iter.peek() {
|
||||||
let _ = iter.next().unwrap();
|
let _ = iter.next().unwrap();
|
||||||
let content = iter.next().expect("no content specified").value;
|
//panic!("{iter:?}");
|
||||||
let alternate = iter.next().expect("no alternate specified").value;
|
|
||||||
return Some(Self(
|
return Some(Self(
|
||||||
state.get(&mut iter)
|
state.get(&mut iter).expect("no condition provided"),
|
||||||
.expect("no condition provided"),
|
state.get_content(&iter.next().expect("no content specified").value)
|
||||||
state.get_content(&content)
|
.unwrap_or_else(||panic!("no content 1: {iter:?}")),
|
||||||
.unwrap_or_else(||panic!("no content 1 corresponding to {:?}", &content)),
|
state.get_content(&iter.next().expect("no alternate specified").value)
|
||||||
state.get_content(&alternate)
|
.unwrap_or_else(||panic!("no content 2: {iter:?}")),
|
||||||
.unwrap_or_else(||panic!("no content 2 corresponding to {:?}", &alternate)),
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue