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

Method call_reversed

compiler/src/modules/vm/builtins/sequence.rs:228–239  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

226 }
227
228 pub fn call_reversed(&mut self) -> Result<(), VmErr> {
229 let o = self.pop()?;
230 if !o.is_heap() { return Err(cold_type("reversed() requires a sequence")); }
231 let mut items = if let HeapObj::Str(s) = self.heap.get(o) {
232 let s = s.clone();
233 self.str_to_char_vals(&s)?
234 } else {
235 self.extract_iter(o, true)?
236 };
237 items.reverse();
238 self.alloc_and_push_list(items)
239 }
240
241 pub fn call_enumerate(&mut self, op: u16) -> Result<(), VmErr> {
242 let (positional, kw_flat, _np, _nk) = self.parse_call_args(op)?;

Callers 2

handle_functionMethod · 0.80
dispatch_nativeMethod · 0.80

Calls 7

cold_typeFunction · 0.85
is_heapMethod · 0.80
str_to_char_valsMethod · 0.80
extract_iterMethod · 0.80
alloc_and_push_listMethod · 0.80
popMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected