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 <mail@tazj.in> Tested-by: BuildkiteCI
This commit is contained in:
parent
30a6fcccee
commit
49c4cc6c56
4 changed files with 80 additions and 1 deletions
8
users/tazjin/rlox/src/bytecode/opcode.rs
Normal file
8
users/tazjin/rlox/src/bytecode/opcode.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#[derive(Debug)]
|
||||
pub enum OpCode {
|
||||
/// Access a constant for use.
|
||||
OpConstant(usize),
|
||||
|
||||
/// Return from the current function.
|
||||
OpReturn,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue