about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/bytecode/mod.rs
blob: a58f610417fd5ec3101f2b66ff07186a334a9fc9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//! Bytecode interpreter for Lox.
//!
//! https://craftinginterpreters.com/chunks-of-bytecode.html

mod chunk;
mod opcode;
mod value;

use chunk::Chunk;
use opcode::OpCode;

pub fn main() {
    let mut chunk: Chunk = Default::default();

    let constant = chunk.add_constant(1.2);
    chunk.add_op(OpCode::OpConstant(constant));
    chunk.add_op(OpCode::OpReturn);

    chunk::disassemble(&chunk, "test chunk");
}