diff --git a/src/machine.rs b/src/machine.rs index a9f3779..8c7f524 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -29,22 +29,18 @@ pub struct Machine<'a> { } impl<'a> Machine<'a> { - pub fn new(code: &str, input: &'a mut BufReader>, output: &'a mut BufWriter>) -> Self { + pub fn new(code: Vec, input: &'a mut BufReader>, output: &'a mut BufWriter>) -> Self { Machine { ip: 0, mp: 0, buf: [0; 1], memory: [0; 50000], - code: parse(code), + code, input, output, } } - pub fn parse(code: &str){ - return; - } - pub fn execute(&mut self){ // prevent ip from getting out of bounds while self.ip < self.code.len() {