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