remove unused things
parent
e11026a553
commit
66fe54adef
|
@ -468,14 +468,6 @@ impl State {
|
|||
let block = self.chunk.blocks.get (frame.block_idx).unwrap ();
|
||||
let constants = &block.constants;
|
||||
|
||||
let value = if k {
|
||||
&constants [usize::from (c)]
|
||||
}
|
||||
else {
|
||||
self.reg (c)
|
||||
}
|
||||
.clone ();
|
||||
|
||||
let b = usize::try_from (b).unwrap ();
|
||||
|
||||
let key = match constants.get (b).unwrap () {
|
||||
|
@ -483,6 +475,13 @@ impl State {
|
|||
_ => panic! ("SetField only supports string keys"),
|
||||
};
|
||||
|
||||
let value = if k {
|
||||
&constants [usize::from (c)]
|
||||
}
|
||||
else {
|
||||
self.reg_mut (c)
|
||||
}.clone ();
|
||||
|
||||
let mut dst = self.reg (a).as_table ()
|
||||
.expect ("SetField only works on tables").borrow_mut ();
|
||||
|
||||
|
@ -506,12 +505,8 @@ impl State {
|
|||
|
||||
pub fn step (&mut self) -> Result <Option <StepOutput>, StepError>
|
||||
{
|
||||
self.step_count += 1;
|
||||
|
||||
let block = self.chunk.blocks.get (self.block_idx).unwrap ();
|
||||
|
||||
let pc = usize::try_from (self.next_pc).expect ("program_counter is not a valid usize");
|
||||
let instruction = match block.instructions.get (pc) {
|
||||
let instruction = match block.instructions.get (self.next_pc) {
|
||||
Some (x) => *x,
|
||||
None => {
|
||||
dbg! (&self.stack);
|
||||
|
@ -519,7 +514,6 @@ impl State {
|
|||
}
|
||||
};
|
||||
|
||||
// let r = &mut self.registers [frame.register_offset..];
|
||||
let k = &block.constants;
|
||||
|
||||
let make_step_error = |msg| {
|
||||
|
|
Loading…
Reference in New Issue