Skip to content

Commit

Permalink
Forgot to rustfmt before pushing again
Browse files Browse the repository at this point in the history
  • Loading branch information
rctcwyvrn committed Aug 28, 2020
1 parent 328b6c5 commit e575aba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,12 +619,11 @@ impl Compiler<'_> {
// At the time of OpGetSuper we want to know 2 things
// 1. The superclass we're going to be looking for values in
// 2. A pointer to the instance we want to bind the method to

let superclass_val = Value::LoxClass(superclass_index);
self.emit_constant(superclass_val);
self.named_variable(&String::from("this"), false); // Slightly better?
self.emit_instr(OpCode::OpGetSuper(name_index));

}

fn method(&mut self) {
Expand Down
5 changes: 4 additions & 1 deletion src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ impl HeapObjVal {
.unwrap(),
closure
),
HeapObjVal::LoxInstance(instance) => format!("<instance {}>", vm.classes.get(instance.class).unwrap().name),
HeapObjVal::LoxInstance(instance) => format!(
"<instance {}>",
vm.classes.get(instance.class).unwrap().name
),
HeapObjVal::HeapPlaceholder => {
panic!("VM panic! How did a placeholder value get here?")
}
Expand Down

0 comments on commit e575aba

Please sign in to comment.