From 49c4cc6c56048dbf35dbe5d87837d47b80d90f82 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 17 Jan 2021 20:33:39 +0300 Subject: feat(tazjin/rlox): Initial bytecode representation This is significantly simplified from the version in the book, since I'm using Rust's Vec and not implementing dynamic arrays manually. We'll see if I run into issues with that ... Change-Id: Ie3446ac3884b850f3ba73a4b1a6ca14e68054188 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2413 Reviewed-by: tazjin Tested-by: BuildkiteCI --- users/tazjin/rlox/src/bytecode/opcode.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 users/tazjin/rlox/src/bytecode/opcode.rs (limited to 'users/tazjin/rlox/src/bytecode/opcode.rs') diff --git a/users/tazjin/rlox/src/bytecode/opcode.rs b/users/tazjin/rlox/src/bytecode/opcode.rs new file mode 100644 index 000000000000..f2b6a9f1baf3 --- /dev/null +++ b/users/tazjin/rlox/src/bytecode/opcode.rs @@ -0,0 +1,8 @@ +#[derive(Debug)] +pub enum OpCode { + /// Access a constant for use. + OpConstant(usize), + + /// Return from the current function. + OpReturn, +} -- cgit 1.4.1