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
//! Source positions, source files, and interned identifiers.
//!
//! Five vocabularies that every later phase speaks, and nothing else:
//!
//! - [`Idx`] and [`IndexVec`], the typed indices and index-keyed vectors every
//! phase artifact stores its nodes in; the `index` module says why.
//! - [`Span`], a byte extent that carries its [`FileId`]. Everything a
//! diagnostic points at is one of these, and because the file travels inside
//! the span, one [`SourceMap`] reads back a span from any file of a
//! compilation.
//! - [`SourceMap`], the append-only owner of the text those spans index into,
//! plus the line index a caret needs.
//! - [`Symbol`] and [`Interner`], so a name is a four-byte integer comparison
//! rather than a string comparison.
//! - [`RunId`], [`TaskPath`], [`CallRef`] and [`Moment`], the places in a
//! run, as a span is a place in source. The `place` module holds the one
//! grammar they are written in, so a frame, a history, a diagnostic and a
//! command line all read and write them the same way.
//!
//! # What is deliberately absent
//!
//! **No file loading.** This crate never reads a path. Turning a path into text
//! is an operating-system act, and one crate in this workspace owns those.
//!
//! **No `Symbol` serialization.** A symbol index means nothing without the
//! interner that produced it; a serialized one would be a number that reads
//! like a name. Code that persists an identifier persists its text.
//!
//! **No reserved-word table.** `flow-lexer` owns the reserved words and turns
//! those spellings into distinct token kinds before any interning happens.
pub use count;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
const _: = assert!;
/// Widens a `u32` offset, index or count to `usize`.
///
/// Every offset, index and count this workspace stores is a `u32`, and every
/// target it builds for has a `usize` at least as wide (the assertion above
/// refuses one that does not), so the conversion never loses a bit. It is a
/// `const fn` because indices are widened in `const` contexts, where
/// `usize::try_from` is unavailable.
pub const