Expand description
A crate for easily changing the span for TokenTrees, possibly recursing over Groups,
usable with quote.
use proc_macro2::{
Ident,
Span,
};
use quote_respanned::QuoteRespanned;
let my_ident = Ident::new("my_variable", Span::call_site());
let original = quote::quote! {
fn my_function() {
let #my_ident = 42;
}
};
// Now everything, including `my_ident`, will have the mixed_site span.
QuoteRespanned::new(original, Span::mixed_site());Structs§
- Quote
Relocated has_span_resolution - Changes the resolution site for
Spans. - Quote
Relocated Iter has_span_resolution - This iterator is used by
QuoteRelocated. - Quote
Reresolved has_span_resolution - Changes the resolution site for
Spans. - Quote
Reresolved Iter has_span_resolution - This iterator is used by
QuoteReresolved. - Quote
Respanned - Replaces the span entirely.
- Quote
Respanned Iter - This iterator is used by
QuoteRespanned.