fix bug
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user