From b4d0dde781ca16f9e31332eea1273b18faa7daf2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 10 May 2024 14:39:13 +0100 Subject: [PATCH] fix and commentary --- macros/macros.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/macros/macros.rs b/macros/macros.rs index b532ce7..0f66a6b 100644 --- a/macros/macros.rs +++ b/macros/macros.rs @@ -7,6 +7,9 @@ pub fn dbg_dump(input: TokenStream) -> TokenStream { input } +/// Reconstructs, identically, all the `Group`s in a `TokenStream` +/// +/// (We don't bother adjusting spans.) #[proc_macro] pub fn reconstruct_groups(input: TokenStream) -> TokenStream { fn recurse(input: TokenStream) -> TokenStream { @@ -16,7 +19,7 @@ pub fn reconstruct_groups(input: TokenStream) -> TokenStream { TokenTree::Group(g) => { let delim = g.delimiter(); dbg!(&delim); - let stream = reconstruct_groups(g.stream()); + let stream = recurse(g.stream()); TokenTree::Group(Group::new(delim, stream)) }, other => other, -- 2.30.2