diff options
| author | Sophie Forrest <git@sophieforrest.com> | 2024-08-30 23:35:45 +1200 |
|---|---|---|
| committer | Sophie Forrest <git@sophieforrest.com> | 2024-08-30 23:35:45 +1200 |
| commit | 13b95941183666fadd090314e4e9af33283084cd (patch) | |
| tree | 2831968068a77b7a37a37d1356e9673d4dcc3275 /src/executor.rs | |
| parent | f5f789540ad7d3f7f4f855c9db69d65cfc190ee0 (diff) | |
feat(engine)!: implement u32 engine
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 |