fn end_loop(&mut self) -> Result<(), EvalError> {
        let loop_begin = match self.loop_stack.pop() {
            Some(pointer) => pointer,
            None => return Err(EvalError::UnbalancedBracket),
        };
        if self.memory[self.memory_pointer] != 0 {
            self.instruction_pointer = loop_begin;
            self.loop_stack.push(loop_begin);
        }
        Ok(())
    }
// By using stack to memorize index of `[`, jump to corresponding loop origin without scanning code again.
By using stack to memorize index of `[`, jump to corresponding loop origin without scanning code again.
By using stack to memorize index of ` [ ` jump to corresponding loop origin without scanning code again .
fn end_loop(&mut self) -> Result<(), EvalError> {
        let loop_begin = match self.loop_stack.pop() {
            Some(pointer) => pointer,
            None => return Err(EvalError::UnbalancedBracket),
        };
        if self.memory[self.memory_pointer] != 0 {
            self.instruction_pointer = loop_begin;
            self.loop_stack.push(loop_begin);
        }
        Ok(())
    }
fn end_loop ( & mut self ) -> Result < ( ) , EvalError > { let loop_begin = match self . loop_stack . pop ( ) { Some ( pointer ) => pointer , None => return Err ( EvalError :: UnbalancedBracket ) , } ; if self . memory [ self . memory_pointer ] != 0 { self . instruction_pointer = loop_begin ; self . loop_stack . push ( loop_begin ) ; } Ok ( ( ) ) }
By using stack to memorize index of `[`, jump to corresponding loop origin without scanning code again.
By using stack to memorize index of ` [ ` jump to corresponding loop origin without scanning code again .
&mut self
&mut self