Skip to content

better integration for execute_statements

The current implementation is the following:

pub fn execute_statements(statements: &Vec<char>, inital_state: &ProgramState) -> ProgramState

this doesn't allow for much implementation with errors. As of now, for loops the program checks if there is a closing bracket. And if it doesn't find one it returns a default one. Use an implementation with Result<T, E> instead:

pub fn execute_statements(statements: &Vec<char>, inital_state: &ProgramState) -> Result<ProgramState, std::io::Error>