diff options
Diffstat (limited to '')
| -rw-r--r-- | src/executor.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/executor.rs b/src/executor.rs index eddf443..da7d676 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -9,14 +9,14 @@ use crate::{engine::Engine, parser::Instruction}; /// Runtime errors that can occur in brainfuck executor. #[derive(Debug, Diagnostic, Error)] pub enum Error { + /// Brainfuck engine ran into an error at runtime. + #[error(transparent)] + Engine(#[from] crate::engine::Error), + /// Brainfuck code performed an out of bounds index on the tape during /// runtime. #[error("tape indexed out of bounds, attempted index at `{0}`")] IndexOutOfBounds(usize), - - /// Executor was unable to read an input byte from stdin. - #[error("could not read input from stdin")] - ReadInput(#[from] std::io::Error), } /// Struct for executor implementation, allows u8 Engine to be implemented. @@ -27,6 +27,10 @@ pub struct U8; #[derive(Clone, Copy, Debug)] pub struct U16; +/// Struct for executor implementation, allows u32 Engine to be implemented. +#[derive(Clone, Copy, Debug)] +pub struct U32; + /// Executes the provided instruction set, utilising the provided tape.. /// /// # Errors |