Compiles one loop guard expression to a temporary boolean register.
(
ctx: &mut Context,
symtable: &mut LocalSymtable<'_>,
guard: Expr,
)
| 495 | fn compile_do(ctx: &mut Context, symtable: &mut LocalSymtable<'_>, span: DoSpan) -> Result<()> { |
| 496 | /// Compiles one loop guard expression to a temporary boolean register. |
| 497 | fn compile_guard( |
| 498 | ctx: &mut Context, |
| 499 | symtable: &mut LocalSymtable<'_>, |
| 500 | guard: Expr, |
| 501 | ) -> Result<(Register, LineCol)> { |
| 502 | let guard_pos = guard.start_pos(); |
| 503 | let mut frozen = symtable.frozen(); |
| 504 | let mut scope = frozen.temp_scope(); |
| 505 | let reg = scope.alloc().map_err(|e| Error::from_syms(e, guard_pos))?; |
| 506 | compile_expr_as_type(&mut ctx.codegen, &mut frozen, reg, guard, ExprType::Boolean)?; |
| 507 | Ok((reg, guard_pos)) |
| 508 | } |
| 509 | |
| 510 | ctx.do_exit_stack.push(vec![]); |
| 511 |
no test coverage detected