From 7effac3febc5734252eb2a750978f99d92375407 Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 29 Jul 2020 20:29:11 +0200 Subject: [PATCH] Add getter for CharStateMachine index --- Cargo.toml | 2 +- src/tapemachine.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fc3d61c..d26458f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "charred" -version = "0.1.4" +version = "0.1.5" authors = ["trivernis "] edition = "2018" license-file = "LICENSE" diff --git a/src/tapemachine.rs b/src/tapemachine.rs index 432fa7b..c5786c3 100644 --- a/src/tapemachine.rs +++ b/src/tapemachine.rs @@ -52,6 +52,10 @@ impl CharTapeMachine { self.text.clone() } + pub fn get_index(&self) -> usize { + self.index + } + /// Returns the next char /// if there is any pub fn next_char(&mut self) -> Option {