mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 03:36: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| {
|
||||
if let Some(Token { value: Value::Key("either"), .. }) = iter.peek() {
|
||||
let _ = iter.next().unwrap();
|
||||
let content = iter.next().expect("no content specified").value;
|
||||
let alternate = iter.next().expect("no alternate specified").value;
|
||||
//panic!("{iter:?}");
|
||||
return Some(Self(
|
||||
state.get(&mut iter)
|
||||
.expect("no condition provided"),
|
||||
state.get_content(&content)
|
||||
.unwrap_or_else(||panic!("no content 1 corresponding to {:?}", &content)),
|
||||
state.get_content(&alternate)
|
||||
.unwrap_or_else(||panic!("no content 2 corresponding to {:?}", &alternate)),
|
||||
state.get(&mut iter).expect("no condition provided"),
|
||||
state.get_content(&iter.next().expect("no content specified").value)
|
||||
.unwrap_or_else(||panic!("no content 1: {iter:?}")),
|
||||
state.get_content(&iter.next().expect("no alternate specified").value)
|
||||
.unwrap_or_else(||panic!("no content 2: {iter:?}")),
|
||||
))
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue