From 18d7955b7d84c00467ede38baae53f4ce1fb6908 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 20 Jan 2023 13:48:26 +0800 Subject: chain: a prototype is added. I have an ostensibly working prototype now. Further tests are needed to make sure that the algorithm meets the time complexity requirement, though. --- graph_macro/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'graph_macro') diff --git a/graph_macro/src/lib.rs b/graph_macro/src/lib.rs index 5a0672b..a55efbb 100644 --- a/graph_macro/src/lib.rs +++ b/graph_macro/src/lib.rs @@ -1,12 +1,19 @@ +#![allow(unused_imports)] //! This file provides a macro to delegate the implementation of a //! type that wraps a graph. More precisely, the macro helps the //! wrapper type implement the various Graph-related traits. use proc_macro::TokenStream; +use core::iter::Peekable; + #[proc_macro_derive(Testing)] pub fn test_derive(input: TokenStream) -> TokenStream { - println!("input: {input:?}"); + let input = input.into_iter().peekable(); + + for tree in input { + println!("tree = {tree:?}"); + } TokenStream::new() } -- cgit v1.2.3-18-g5258