mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
MAINT: Cleanup up the InitThunk operation to use i32
This commit is contained in:
parent
996d8821d7
commit
673cb8f8b7
@ -109,8 +109,7 @@ pub enum Op {
|
||||
// Spacer operation, Does nothing.
|
||||
Noop,
|
||||
// Pending Computation
|
||||
// TODO(jwall): This is unnecessary. Remove it.
|
||||
InitThunk(usize),
|
||||
InitThunk(i32), // Basically just used for module return expressions
|
||||
Module(usize),
|
||||
Func(usize),
|
||||
Return,
|
||||
@ -178,8 +177,7 @@ impl<'a> VM<'a> {
|
||||
Op::Cp => self.op_copy()?,
|
||||
//TODO(jwall): Should this take a user provided message?
|
||||
Op::Bang => return dbg!(Err(Error {})),
|
||||
// TODO(jwall): Remove this
|
||||
Op::InitThunk(jp) => self.op_thunk(idx, *jp as i32)?,
|
||||
Op::InitThunk(jp) => self.op_thunk(idx, *jp)?,
|
||||
Op::Noop => {
|
||||
// Do nothing
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ use super::Op::{
|
||||
Val,
|
||||
};
|
||||
use super::Primitive::{Bool, Float, Int, Str};
|
||||
use super::Value::{C, P, T};
|
||||
use super::Value::{C, P};
|
||||
use super::VM;
|
||||
|
||||
macro_rules! assert_cases {
|
||||
@ -407,13 +407,13 @@ fn test_select_short_circuit() {
|
||||
Sym("field".to_owned()), // 0 // search field
|
||||
Sym("not_field".to_owned()), // 1 // first field to compare
|
||||
JumpIfNotEqual(2), // 2
|
||||
Val(Str("not our value".to_owned())), // 3
|
||||
Val(Str("not our value".to_owned())), // 3 // expression for first field
|
||||
Jump(4), // 4
|
||||
Sym("field".to_owned()), // 5 // second field to compare
|
||||
JumpIfNotEqual(2), // 6
|
||||
Val(Int(1)), // 7
|
||||
Val(Int(1)), // 7 // expression for second field
|
||||
Jump(1), // 8
|
||||
Bang, // 9
|
||||
Bang, // 9 // default case
|
||||
] => P(Int(1)),
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user