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
use crateByteSpan;
use Cow;
/// A "trivia token" is a token that doesn't affect parsing but is still
/// preserved (e.g. for tooling use).
///
/// Trivia includes comments, commas, and whitespace, which are attached to
/// the following token as "preceding trivia". This allows formatters and
/// linters to preserve these elements without the parser needing to handle
/// them explicitly.
///
/// # Lifetime Parameter
///
/// The `'src` lifetime enables zero-copy lexing for comment and whitespace
/// values: `StrGraphQLTokenSource` can borrow text directly from the source.