Add err function for easier error creation

master
trivernis 4 years ago
parent 7effac3feb
commit 433d41297c

@ -1,6 +1,6 @@
[package]
name = "charred"
version = "0.1.5"
version = "0.1.6"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"
license-file = "LICENSE"

@ -48,14 +48,22 @@ impl CharTapeMachine {
}
}
#[inline]
pub fn get_text(&self) -> Vec<char> {
self.text.clone()
}
#[inline]
pub fn get_index(&self) -> usize {
self.index
}
/// Creates an error at the current position
#[inline]
pub fn err(&self) -> TapeError {
TapeError::new(self.index)
}
/// Returns the next char
/// if there is any
pub fn next_char(&mut self) -> Option<char> {

Loading…
Cancel
Save