Appends a new instruction `op` generated at `pos` to the code and returns its address.
(&mut self, op: u32, pos: LineCol)
| 79 | |
| 80 | /// Appends a new instruction `op` generated at `pos` to the code and returns its address. |
| 81 | pub(super) fn emit(&mut self, op: u32, pos: LineCol) -> Address { |
| 82 | self.code.push(op); |
| 83 | self.instrs.push(InstrMetadata { |
| 84 | linecol: pos, |
| 85 | is_stmt_start: false, |
| 86 | arg_linecols: vec![], |
| 87 | }); |
| 88 | self.code.len() - 1 |
| 89 | } |
| 90 | |
| 91 | /// Marks the instruction at `addr` as the start of a statement. |
| 92 | pub(super) fn mark_statement_start(&mut self, addr: Address) { |