diff options
Diffstat (limited to 'tvix/eval')
-rw-r--r-- | tvix/eval/src/main.rs | 1 | ||||
-rw-r--r-- | tvix/eval/src/opcode.rs | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/tvix/eval/src/main.rs b/tvix/eval/src/main.rs index 7cc5a380e525..fc366961b536 100644 --- a/tvix/eval/src/main.rs +++ b/tvix/eval/src/main.rs @@ -6,6 +6,7 @@ use std::{ mod errors; mod eval; +mod opcode; mod value; fn main() { diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs new file mode 100644 index 000000000000..b43f75efaa8f --- /dev/null +++ b/tvix/eval/src/opcode.rs @@ -0,0 +1,19 @@ +//! This module implements the instruction set running on the abstract +//! machine implemented by tvix. + +#[derive(Clone, Copy, Debug)] +pub struct ConstantIdx(pub usize); + +#[derive(Clone, Copy, Debug)] +pub struct CodeIdx(pub usize); + +#[derive(Clone, Copy, Debug)] +pub enum OpCode { + // Push a constant onto the stack. + OpConstant(ConstantIdx), + + // Push a literal value. + OpNull, + OpTrue, + OpFalse, +} |