From 4d3eca0e7fb84fa66fca55b0a70df1694ba60285 Mon Sep 17 00:00:00 2001 From: aaron Date: Tue, 21 Sep 2021 00:04:41 +0200 Subject: [PATCH] fix bug --- src/machine.rs | 1 + src/parser.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/machine.rs b/src/machine.rs index 65c2e0d..705e940 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -30,6 +30,7 @@ impl<'a> Machine<'a> { while self.ip < self.code.len() { // get current instruction let instruction = &self.code[self.ip]; + println!("{:?}", instruction); // match type and execute match instruction.itype { InstructionType::Increment => { diff --git a/src/parser.rs b/src/parser.rs index a32310f..4645a95 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -43,7 +43,7 @@ impl Parser { fn load_instruction(&mut self, itype: InstructionType) { let instruction = Instruction { itype, - argument: 0, + argument: 1, }; self.instructions.push(instruction);