aboutsummaryrefslogtreecommitdiffstats
path: root/bytecode/src/encoding.rs
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-03-03 13:48:19 -0800
committerRose Hogenson <rhogenson@posteo.net>2022-03-03 13:48:19 -0800
commit056fbf7e7dc727d020ba54e439f2b47411c58e76 (patch)
treea85cd582c4b06932463c4754ef466216d9afc8aa /bytecode/src/encoding.rs
parent1dd8b1f6eaf611cf5525065aa18f20baa1ada5f3 (diff)
downloadchromatopelma-056fbf7e7dc727d020ba54e439f2b47411c58e76.tar.zst
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.
Diffstat (limited to 'bytecode/src/encoding.rs')
-rw-r--r--bytecode/src/encoding.rs12
1 files changed, 6 insertions, 6 deletions
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<T: Read>(prog: &mut T) -> Result<Op, String> {
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])
);
}