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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use PhantomData;
use crateConstStr;
/// A single path segment of the type-level path constructed by [`Cursor!`](macro@crate::Cursor).
///
/// See the [crate-level](crate) documentation for more info.
/// Equivalent to `const PATH_SEGMENT: PathSegment`, except it works on stable Rust.
/// Accessing a specific field of a map.
/// Represents the `package` in `Cursor!(package[0])`.
///
/// ```txt
/// Cursor!(field[0])
/// ^^^^^
/// ```
///
/// # The `Z` const-generic
///
/// It is always `false`.
///
/// This const-generic only exists so we can create an arbitrary amount of string literals
/// whose spans we associate with the user's input when they are writing the Cursor! macro
///
/// e.g. we want to syntax highlight the "dev-dependencies" as a single string:
///
/// ```txt
/// Cursor!(dev-dependencies)
/// ```
///
/// But that is made up of 3 tokens, and each of their `Span`s needs to associate with
/// a concrete token.
///
/// ```txt
/// Field<..., { ["", "", ""]; false }>
/// ^^ "dev"
/// ^^ "-"
/// ^^ "dependencies"
/// ```
;
/// Access a specific element of a sequence.
/// Represents the `0` in `Cursor!(package[].dependencies[0])`.
///
/// ```txt
/// Cursor!(field[0])
/// ^
/// ```
;