1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
use Span;
/// A parsed string literal, bundling the extracted text with its source location.
///
/// `LitStr` is returned by [`extract_litstr`] when you need more than just the
/// string contents, specifically when you need to emit diagnostics that point
/// back at the original literal in the macro input.
///
/// # Example
///
/// ```ignore
/// use litext::{litext, TokenStream};
///
/// pub fn my_macro(input: TokenStream) -> TokenStream {
/// let lit = litext!(input as LitStr);
/// println!("value: {}", lit.value());
/// // lit.span() can be used with Diagnostic::spanned for precise errors
/// }
/// ```