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

Method build_slice

compiler/src/modules/vm/builtins/container.rs:75–81  ·  view source on GitHub ↗
(&mut self, op: u16)

Source from the content-addressed store, hash-verified

73 }
74
75 pub fn build_slice(&mut self, op: u16) -> Result<(), VmErr> {
76 let step = if op == 3 { self.pop()? } else { Val::none() };
77 let stop = self.pop()?;
78 let start = self.pop()?;
79 let val = self.heap.alloc(HeapObj::Slice(start, stop, step))?;
80 self.push(val); Ok(())
81 }
82
83 pub fn unpack_ex(&mut self, op: u16) -> Result<(), VmErr> {
84 let obj = self.pop()?;

Callers 1

handle_buildMethod · 0.80

Calls 3

pushMethod · 0.80
popMethod · 0.45
allocMethod · 0.45

Tested by

no test coverage detected