Compiles `exprs` into consecutive integer registers allocated from `scope` and returns the first register. The caller must guarantee that `exprs` is non-empty.
(
codegen: &mut Codegen,
symtable: &mut TempSymtable<'_, '_>,
scope: &mut TempScope,
pos: LineCol,
exprs: impl Iterator<Item = Expr>,
)
| 28 | /// Compiles `exprs` into consecutive integer registers allocated from `scope` and returns the |
| 29 | /// first register. The caller must guarantee that `exprs` is non-empty. |
| 30 | pub(super) fn compile_integer_exprs( |
| 31 | codegen: &mut Codegen, |
| 32 | symtable: &mut TempSymtable<'_, '_>, |
| 33 | scope: &mut TempScope, |
| 34 | pos: LineCol, |
| 35 | exprs: impl Iterator<Item = Expr>, |
| 36 | ) -> Result<Register> { |
| 37 | let mut first_reg = None; |
| 38 | for expr in exprs { |
| 39 | let reg = scope.alloc().map_err(|e| Error::from_syms(e, pos))?; |
| 40 | if first_reg.is_none() { |
| 41 | first_reg = Some(reg); |
| 42 | } |
| 43 | compile_expr_as_type(codegen, symtable, reg, expr, ExprType::Integer)?; |
| 44 | } |
| 45 | Ok(first_reg.expect("Must have at least one expression")) |
| 46 | } |
| 47 | |
| 48 | /// Compiles an array element access expression into `reg`. |
| 49 | fn compile_array_access( |
no test coverage detected