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
// =======================================================================
// cache.rs
// =======================================================================
//! A cache for storing data generated during preprocessing
use crate::*;
use FrozenVec;
/// A cache for storing generated [`Span`]s and strings.
///
/// These objects are only meant to be used internal to the
/// preprocessor. Since the CST only stores references to copy as
/// little as possible, the [`PreprocessorCache`] stores new
/// [`Span`]s and strings created as part of preprocessing (such
/// as when referencing `` `include `` directives and elaborating
/// preprocessor identifiers, respectively). Since the CST stores
/// references to these, a [`PreprocessorCache`] used as part
/// of preprocessing must be kept alive as long as the CST itself.