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 | f752160c6ebcee747a61e6febc4789d0b04ccd12 (patch) | |
| tree | 76e123279abbd1797ba281f35cbcba61136ef7bd /src/utility.rs | |
| parent | 98d7946709032aae5e1d0d35cff78efc55550900 (diff) | |
feat: implement generic engine for executor
Diffstat (limited to 'src/utility.rs')
| -rw-r--r-- | src/utility.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utility.rs b/src/utility.rs index a903273..58ac3e2 100644 --- a/src/utility.rs +++ b/src/utility.rs @@ -2,7 +2,7 @@ use std::path::Path; -use crate::{constants::TapeInner, execute, lex, parse, Error}; +use crate::{constants::TapeInner, lex, parse, Error, Executor}; /// Utility function to execute a Brainfuck file. Lexes, parses and executes the /// input file. @@ -21,7 +21,7 @@ pub fn execute_from_file(path: impl AsRef<Path>, tape: &mut [TapeInner]) -> Resu let mut data_pointer = 0; - execute(&instructions, tape, &mut data_pointer)?; + Executor::execute(&instructions, tape, &mut data_pointer)?; Ok(()) } @@ -41,7 +41,7 @@ pub fn execute_from_str(input: &str, tape: &mut [TapeInner]) -> Result<(), Error let mut data_pointer = 0; - execute(&instructions, tape, &mut data_pointer)?; + Executor::execute(&instructions, tape, &mut data_pointer)?; Ok(()) } |