(&mut self, op: u16)
| 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")); } |
| 502 | let o = self.pop()?; |
| 503 | let mut cur = self.iter_cursor(o)?; |
| 504 | while let Some(v) = cur.next(&mut self.heap)? { |
| 505 | self.charge_step()?; // native iteration over a huge range must charge the op-budget |
| 506 | if self.truthy(v) { |
| 507 | self.push(Val::bool(true)); |
| 508 | return Ok(()); |
| 509 | } |
| 510 | } |
| 511 | self.push(Val::bool(false)); |
| 512 | Ok(()) |
| 513 | } |
| 514 | |
| 515 | // Materialise an iterable to a list, strings -> chars, ranges eager, coroutines drained. |
| 516 | pub fn call_list(&mut self, argc: u16, chunk: &crate::modules::parser::SSAChunk, slots: &mut [Val]) -> Result<(), VmErr> { |
no test coverage detected