Rewrites a just-built tuple/list of name loads into individual unbinds. */
(&mut self)
| 630 | |
| 631 | /* Rewrites a just-built tuple/list of name loads into individual unbinds. */ |
| 632 | fn del_group_targets(&mut self) { |
| 633 | let last = self.chunk.instructions.len() - 1; |
| 634 | let n = self.chunk.instructions[last].operand as usize; |
| 635 | if n >= 1 && last >= n |
| 636 | && self.chunk.instructions[last - n..last].iter().all(|i| i.opcode == OpCode::LoadName) { |
| 637 | self.chunk.instructions.truncate(last); |
| 638 | for ins in &mut self.chunk.instructions[last - n..] { ins.opcode = OpCode::Del; } |
| 639 | } |
| 640 | } |
| 641 | |
| 642 | /* Emit `yield` / `yield from` / bare `yield`, leaving the produced value on the stack so it works in both statement and expression position. Assumes the `yield` keyword was already consumed. */ |
| 643 | pub(super) fn emit_yield(&mut self) { |
no test coverage detected