From c458e9f46afcd04445dcb35d1fd9e2a85a451937 Mon Sep 17 00:00:00 2001 From: Cody Date: Mon, 10 Apr 2023 18:25:59 -0500 Subject: Some basic shit --- crates/sloth_bytecode/macros/src/lib.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'crates/sloth_bytecode/macros/src') diff --git a/crates/sloth_bytecode/macros/src/lib.rs b/crates/sloth_bytecode/macros/src/lib.rs index 41035b9..15a09d0 100644 --- a/crates/sloth_bytecode/macros/src/lib.rs +++ b/crates/sloth_bytecode/macros/src/lib.rs @@ -99,7 +99,7 @@ fn into_bytecode_parser(instruction: &DslInstructionInput) -> TokenStream { for byte in 0..bytes { let shift_amount = size - (byte + 1) * bytes; chunks.push(quote! { - ((chunk.code[*offset + #byte] as #arg) << #shift_amount) + ((chunk[*offset + #byte] as #arg) << #shift_amount) }); } @@ -147,8 +147,8 @@ pub fn instructions(input: proc_macro::TokenStream) -> proc_macro::TokenStream { } impl #enum_name { - fn disassemble(chunk: &Chunk, offset: &mut usize) -> #enum_name { - let opcode = chunk.code[*offset]; + fn disassemble(chunk: &[u8], offset: &mut usize) -> #enum_name { + let opcode = chunk[*offset]; *offset += 1; let instruction = match opcode { @@ -158,10 +158,6 @@ pub fn instructions(input: proc_macro::TokenStream) -> proc_macro::TokenStream { instruction } - - fn assemble(chunk: &mut Chunk) { - // - } } } .into() -- cgit v1.2.3