This commit is contained in:
2021-09-21 00:04:41 +02:00
parent da99c5b4d1
commit 4d3eca0e7f
2 changed files with 2 additions and 1 deletions

View File

@@ -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 => {

View File

@@ -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);