fn corresponding_loop_end(&self) -> Result<usize, EvalError> {
        let mut nest_level = 0;
        let mut instruction_pointer = self.instruction_pointer + 1;
        while nest_level > 0 || self.instructions[instruction_pointer] != Instructions::EndLoop {
            if self.instructions[instruction_pointer] == Instructions::BeginLoop {
                nest_level += 1;
            } else if self.instructions[instruction_pointer] == Instructions::EndLoop {
                nest_level -= 1;
            }
            instruction_pointer += 1;
            if instruction_pointer == self.instructions.len() {
                return Err(EvalError::UnbalancedBracket);
            }
        }
        Ok(instruction_pointer)
    }
// Returns index of corresponding loop end.
Returns index of corresponding loop end.
Returns index of corresponding loop end .
fn corresponding_loop_end(&self) -> Result<usize, EvalError> {
        let mut nest_level = 0;
        let mut instruction_pointer = self.instruction_pointer + 1;
        while nest_level > 0 || self.instructions[instruction_pointer] != Instructions::EndLoop {
            if self.instructions[instruction_pointer] == Instructions::BeginLoop {
                nest_level += 1;
            } else if self.instructions[instruction_pointer] == Instructions::EndLoop {
                nest_level -= 1;
            }
            instruction_pointer += 1;
            if instruction_pointer == self.instructions.len() {
                return Err(EvalError::UnbalancedBracket);
            }
        }
        Ok(instruction_pointer)
    }
fn corresponding_loop_end ( & self ) -> Result < usize , EvalError > { let mut nest_level = 0 ; let mut instruction_pointer = self . instruction_pointer + 1 ; while nest_level > 0 || self . instructions [ instruction_pointer ] != Instructions :: EndLoop { if self . instructions [ instruction_pointer ] == Instructions :: BeginLoop { nest_level += 1 ; } else if self . instructions [ instruction_pointer ] == Instructions :: EndLoop { nest_level -= 1 ; } instruction_pointer += 1 ; if instruction_pointer == self . instructions . len ( ) { return Err ( EvalError :: UnbalancedBracket ) ; } } Ok ( instruction_pointer ) }
Returns index of corresponding loop end.
Returns index of corresponding loop end .
&self
&self