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
use String;
use crateGetUnwrap;
/// An index into a [`StringPool`].
///
/// This is only meaningful for the pool that produced it.
;
/// A pool of strings which have been copied out of the input.
///
/// This exists so that tokens can refer to pieces of the input without borrowing it. There is
/// only one pool, which belongs to the
/// [`TokenQueue`](crate::token_queue::TokenQueue) and dies with it, so an [`InternedStr`] is
/// only good for as long as the conversion which produced it; anything which has to outlive
/// that gets a copy of the string instead.
///
/// Strings are not deduplicated; two calls to [`StringPool::intern`] with the same string
/// yield two different [`InternedStr`] values.
;