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

Method call_all

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

Source from the content-addressed store, hash-verified

483 }
484
485 pub fn call_all(&mut self, op: u16) -> Result<(), VmErr> {
486 if op != 1 { return Err(cold_type("all() takes exactly 1 argument")); }
487 let o = self.pop()?;
488 let mut cur = self.iter_cursor(o)?;
489 while let Some(v) = cur.next(&mut self.heap)? {
490 self.charge_step()?; // native iteration over a huge range must charge the op-budget
491 if !self.truthy(v) {
492 self.push(Val::bool(false));
493 return Ok(());
494 }
495 }
496 self.push(Val::bool(true));
497 Ok(())
498 }
499
500 pub fn call_any(&mut self, op: u16) -> Result<(), VmErr> {
501 if op != 1 { return Err(cold_type("any() takes exactly 1 argument")); }

Callers 2

handle_functionMethod · 0.80
dispatch_nativeMethod · 0.80

Calls 7

cold_typeFunction · 0.85
iter_cursorMethod · 0.80
nextMethod · 0.80
charge_stepMethod · 0.80
truthyMethod · 0.80
pushMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected