From 056fbf7e7dc727d020ba54e439f2b47411c58e76 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Thu, 3 Mar 2022 13:48:19 -0800 Subject: Start the garbage collector. I don't think we finished it, but I wrote this code a while ago and I'm just trying to get it committed. --- bytecode/src/encoding.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bytecode/src/encoding.rs') diff --git a/bytecode/src/encoding.rs b/bytecode/src/encoding.rs index b3a7983..deacae5 100644 --- a/bytecode/src/encoding.rs +++ b/bytecode/src/encoding.rs @@ -43,8 +43,8 @@ fn op_decoding(prog: &mut T) -> Result { 1050 => Op::Div, 1060 => Op::Mod, 2010 => Op::Alloc, - 2020 => Op::Peek(read_u8(prog)?), - 2030 => Op::Poke(read_u8(prog)?), + 2020 => Op::Peek, + 2030 => Op::Poke, 2040 => Op::PeekByte, 2050 => Op::PokeByte, 3010 => Op::Pop, @@ -130,16 +130,16 @@ mod tests { #[test] fn decode_peek() { assert_eq!( - Ok(vec![Op::Peek(10)]), - decode(&vec![0xe4, 0x7, 0, 0, 0, 0, 0, 0, 0xa]) + Ok(vec![Op::Peek]), + decode(&vec![0xe4, 0x7, 0, 0, 0, 0, 0, 0]) ); } #[test] fn decode_poke() { assert_eq!( - Ok(vec![Op::Poke(10)]), - decode(&vec![0xee, 0x7, 0, 0, 0, 0, 0, 0, 0xa]) + Ok(vec![Op::Poke]), + decode(&vec![0xee, 0x7, 0, 0, 0, 0, 0, 0]) ); } -- cgit v1.3.1