From f752160c6ebcee747a61e6febc4789d0b04ccd12 Mon Sep 17 00:00:00 2001 From: Sophie Forrest Date: Fri, 30 Aug 2024 23:35:45 +1200 Subject: feat: implement generic engine for executor --- src/utility.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/utility.rs') 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, 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(()) } -- cgit 1.4.1