about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/opcode.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-10-20T13·57+0200
committertazjin <mail@tazj.in>2021-10-22T09·42+0000
commitd57e43e1615ae28cfdc74c1c65cbe7863d782018 (patch)
tree3ff9e6843475aec1573355cf73e6bea209de26da /users/tazjin/rlox/src/bytecode/opcode.rs
parent4ea7fc392a562fac2158973191ad626baca16644 (diff)
refactor(tazjin/rlox): Return index after adding operations r/2985
Change-Id: I100eb9b55ace37e5c7c878d3c224b567ee8d1e36
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3738
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin/rlox/src/bytecode/opcode.rs')
-rw-r--r--users/tazjin/rlox/src/bytecode/opcode.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/bytecode/opcode.rs b/users/tazjin/rlox/src/bytecode/opcode.rs
index d2a264242496..13e2f23939ed 100644
--- a/users/tazjin/rlox/src/bytecode/opcode.rs
+++ b/users/tazjin/rlox/src/bytecode/opcode.rs
@@ -4,6 +4,9 @@ pub struct ConstantIdx(pub usize);
 #[derive(Clone, Copy, Debug)]
 pub struct StackIdx(pub usize);
 
+#[derive(Clone, Copy, Debug)]
+pub struct CodeIdx(pub usize);
+
 #[derive(Debug)]
 pub enum OpCode {
     /// Push a constant onto the stack.