fn execute_for_iter(&self, vm: &VirtualMachine, target: bytecode::Label) -> FrameResult {
        let top_of_stack = self.last_value();
        let next_obj = objiter::get_next_object(vm, &top_of_stack);

        // Check the next object:
        match next_obj {
            Ok(Some(value)) => {
                self.push_value(value);
                Ok(None)
            }
            Ok(None) => {
                // Pop iterator from stack:
                self.pop_value();

                // End of for loop
                self.jump(target);
                Ok(None)
            }
            Err(next_error) => {
                // Pop iterator from stack:
                self.pop_value();
                Err(next_error)
            }
        }
    }
/// The top of stack contains the iterator, lets push it forward
The top of stack contains the iterator, lets push it forward
The top of stack contains the iterator lets push it forward
fn execute_for_iter(&self, vm: &VirtualMachine, target: bytecode::Label) -> FrameResult {
        let top_of_stack = self.last_value();
        let next_obj = objiter::get_next_object(vm, &top_of_stack);
        // Check the next object:
        match next_obj {
            Ok(Some(value)) => {
                self.push_value(value);
                Ok(None)
            }
            Ok(None) => {
                // Pop iterator from stack:
                self.pop_value();
                // End of for loop
                self.jump(target);
                Ok(None)
            }
            Err(next_error) => {
                // Pop iterator from stack:
                self.pop_value();
                Err(next_error)
            }
        }
    }
fn execute_for_iter ( & self , vm : & VirtualMachine , target : bytecode :: Label ) -> FrameResult { let top_of_stack = self . last_value ( ) ; let next_obj = objiter :: get_next_object ( vm , & top_of_stack ) ; // Check the next object: match next_obj { Ok ( Some ( value ) ) => { self . push_value ( value ) ; Ok ( None ) } Ok ( None ) => { // Pop iterator from stack: self . pop_value ( ) ; // End of for loop self . jump ( target ) ; Ok ( None ) } Err ( next_error ) => { // Pop iterator from stack: self . pop_value ( ) ; Err ( next_error ) } } }
The top of stack contains the iterator, lets push it forward
The top of stack contains the iterator lets push it forward
&self
vm
&VirtualMachine
target
bytecode::Label