MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / del_group_targets

Method del_group_targets

compiler/src/modules/parser/stmt.rs:632–640  ·  view source on GitHub ↗

Rewrites a just-built tuple/list of name loads into individual unbinds. */

(&mut self)

Source from the content-addressed store, hash-verified

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) {

Callers 1

parse_del_targetMethod · 0.80

Calls 2

lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected