(&mut self, expr: &Expr, body: &Expr)
| 1396 | } |
| 1397 | |
| 1398 | fn emit_while_loop(&mut self, expr: &Expr, body: &Expr) -> EmitResult { |
| 1399 | let mut out = emitter(); |
| 1400 | |
| 1401 | let expr = self.emit_local(expr, &mut out); |
| 1402 | |
| 1403 | let stmts = wrap_block_and_get_statements(&body); |
| 1404 | let body = self |
| 1405 | .emit_block( |
| 1406 | EmitMode { |
| 1407 | ctx: Ctx::Discard, |
| 1408 | should_return: false, |
| 1409 | }, |
| 1410 | &stmts, |
| 1411 | true, |
| 1412 | ) |
| 1413 | .to_statement(); |
| 1414 | |
| 1415 | out.emit(format!( |
| 1416 | "for ({expr}) {{ |
| 1417 | {body} |
| 1418 | }}", |
| 1419 | )); |
| 1420 | |
| 1421 | out.no_value() |
| 1422 | } |
| 1423 | |
| 1424 | fn emit_loop_flow(&mut self, kind: &LoopFlow) -> EmitResult { |
| 1425 | let mut out = emitter(); |
no test coverage detected