From f3ff9fd684f41cc198b659f50acce88571f654b1 Mon Sep 17 00:00:00 2001 From: Rowan Torbitzky-Lane Date: Mon, 21 Apr 2025 16:36:16 -0500 Subject: [PATCH] internal expansion failed, manually define functions in a list time --- rush_macro/src/lib.rs | 28 ------------------------- rush_macro/src/utils/instructionlist.rs | 2 -- rush_macro/src/utils/mod.rs | 1 - src/main.rs | 7 ------- tests/instruction_test.rs | 3 --- 5 files changed, 41 deletions(-) delete mode 100644 rush_macro/src/utils/instructionlist.rs diff --git a/rush_macro/src/lib.rs b/rush_macro/src/lib.rs index 6bd2848..b737f2f 100644 --- a/rush_macro/src/lib.rs +++ b/rush_macro/src/lib.rs @@ -4,9 +4,6 @@ use syn::parse_macro_input; mod utils; -/// This macro kinda goes super crazy mode -/// Here's how to use the macro: -/// /// `run_instruction!(function_name, output_stack, push state, any amount of /// comma separated stacks by name ; (the semicolon instructs use whether the instruction /// has multiple outputs. If ; passed, assumes multiple, without assumes just one output))` @@ -45,31 +42,6 @@ pub fn run_instruction(input: proc_macro::TokenStream) -> proc_macro::TokenStrea quote! { #f }.into() } -#[proc_macro] -pub fn instruction_list(input: proc_macro::TokenStream) -> proc_macro::TokenStream { - // Convert to proc_macro2::TokenStream for better iteration - let input2: proc_macro2::TokenStream = input.clone().into(); - - println!("Token stream analysis:"); - for token in input2.into_iter() { - match token { - proc_macro2::TokenTree::Group(group) => println!( - "Group: delimiter={:?}, tokens={}", - group.delimiter(), - group.stream() - ), - proc_macro2::TokenTree::Ident(ident) => println!("Identifier: {}", ident), - proc_macro2::TokenTree::Punct(punct) => println!( - "Punctuation: {} (spacing={:?})", - punct.as_char(), - punct.spacing() - ), - proc_macro2::TokenTree::Literal(lit) => println!("Literal: {}", lit), - } - } - input -} - #[cfg(test)] mod tests { #[test] diff --git a/rush_macro/src/utils/instructionlist.rs b/rush_macro/src/utils/instructionlist.rs deleted file mode 100644 index 3d89baf..0000000 --- a/rush_macro/src/utils/instructionlist.rs +++ /dev/null @@ -1,2 +0,0 @@ -//! This file implements the proc macro implementation for creating a list of instructions -//! from a set of passed function declarations. diff --git a/rush_macro/src/utils/mod.rs b/rush_macro/src/utils/mod.rs index b911aaf..28504b1 100644 --- a/rush_macro/src/utils/mod.rs +++ b/rush_macro/src/utils/mod.rs @@ -1,7 +1,6 @@ use syn::parse::{Parse, ParseStream}; pub mod instruction; -pub mod instructionlist; fn parse_zero_or_more(input: ParseStream) -> Vec { let mut result = Vec::new(); diff --git a/src/main.rs b/src/main.rs index 9214a79..d72c355 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -use crate::instructions::*; use crate::push::interpreter::interpret_program; use crate::push::state::EMPTY_STATE; @@ -9,10 +8,4 @@ fn main() { // These need to stay so linter doesn't go crazy. let mut empty_state = EMPTY_STATE; interpret_program(&mut empty_state, 1000, 1000); - - let mut counts: Vec<(&str, usize)> = vec![]; - counts.push(("int", 2)); - counts.push(("float", 1)); - - // counts.iter().map() } diff --git a/tests/instruction_test.rs b/tests/instruction_test.rs index 5d7b70e..62d9004 100644 --- a/tests/instruction_test.rs +++ b/tests/instruction_test.rs @@ -43,6 +43,3 @@ fn run_extract_test() { run_instruction!(aux_char, char, test_state, vector_char;); assert_eq!(vec!['a', 'b'], test_state.char); } - -#[test] -fn instruction_list_test() {}