fix bug
This commit is contained in:
@@ -30,6 +30,7 @@ impl<'a> Machine<'a> {
|
|||||||
while self.ip < self.code.len() {
|
while self.ip < self.code.len() {
|
||||||
// get current instruction
|
// get current instruction
|
||||||
let instruction = &self.code[self.ip];
|
let instruction = &self.code[self.ip];
|
||||||
|
println!("{:?}", instruction);
|
||||||
// match type and execute
|
// match type and execute
|
||||||
match instruction.itype {
|
match instruction.itype {
|
||||||
InstructionType::Increment => {
|
InstructionType::Increment => {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ impl Parser {
|
|||||||
fn load_instruction(&mut self, itype: InstructionType) {
|
fn load_instruction(&mut self, itype: InstructionType) {
|
||||||
let instruction = Instruction {
|
let instruction = Instruction {
|
||||||
itype,
|
itype,
|
||||||
argument: 0,
|
argument: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
self.instructions.push(instruction);
|
self.instructions.push(instruction);
|
||||||
|
|||||||
Reference in New Issue
Block a user