(
&mut self,
s: S,
d: D,
this_id: NodeID,
cond: &Expr,
if_body: &[Stmt],
else_body: &[Stmt],
)
| 75 | } |
| 76 | |
| 77 | pub fn branch( |
| 78 | &mut self, |
| 79 | s: S, |
| 80 | d: D, |
| 81 | this_id: NodeID, |
| 82 | cond: &Expr, |
| 83 | if_body: &[Stmt], |
| 84 | else_body: &[Stmt], |
| 85 | ) -> io::Result<()> { |
| 86 | let cond = coerce_condition(cond); |
| 87 | let cond_id = self.id.new_id(); |
| 88 | let if_body_id = self.id.new_id(); |
| 89 | let else_body_id = self.id.new_id(); |
| 90 | self.begin_inputs()?; |
| 91 | self.input(s, d, "CONDITION", &cond, cond_id)?; |
| 92 | self.substack("SUBSTACK", (!if_body.is_empty()).then_some(if_body_id))?; |
| 93 | self.substack("SUBSTACK2", (!else_body.is_empty()).then_some(else_body_id))?; |
| 94 | self.end_obj()?; // inputs |
| 95 | self.end_obj()?; // node |
| 96 | self.expr(s, d, &cond, cond_id, this_id)?; |
| 97 | self.stmts(s, d, if_body, if_body_id, Some(this_id))?; |
| 98 | self.stmts(s, d, else_body, else_body_id, Some(this_id)) |
| 99 | } |
| 100 | |
| 101 | pub fn until( |
| 102 | &mut self, |
no test coverage detected