Assuming you're using proc_macro2 which is alternative to the compiler's proc_macro
crate, a TokenStream
can be converted into an iterator over TokenTree
s from which you can access the span. Note that for methods like token_tree.span().start() to be meaningful, you'll need to compile with the span-locations
feature and use the nightly toolchain.
Here's a related reply I made in a separate thread for additional context.