|
|
@ -91,9 +91,11 @@ impl CharTapeMachine {
|
|
|
|
/// Rewinds to a given index
|
|
|
|
/// Rewinds to a given index
|
|
|
|
#[inline]
|
|
|
|
#[inline]
|
|
|
|
pub fn rewind(&mut self, index: usize) {
|
|
|
|
pub fn rewind(&mut self, index: usize) {
|
|
|
|
|
|
|
|
if self.text.len() > index {
|
|
|
|
self.index = index;
|
|
|
|
self.index = index;
|
|
|
|
self.current_char = *self.text.get(index).unwrap();
|
|
|
|
self.current_char = *self.text.get(index).unwrap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Rewinds to a given index and returns an error
|
|
|
|
/// Rewinds to a given index and returns an error
|
|
|
|
#[inline]
|
|
|
|
#[inline]
|
|
|
|