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
//! Internal byte-level parser for SIN tokens.
//!
//! This is the only place untrusted input is inspected. The parser is
//! allocation-free, uses no regex engine, and rejects over-long input on a
//! structural length check before any byte is examined. It is reached from
//! outside the crate only through [`crate::Identifier`] (its `parse`,
//! [`core::str::FromStr`], and [`TryFrom`] entry points).
use crateParseError;
use crateIdentifier;
use crateLetter;
/// Parses a string slice into an [`Identifier`].
pub const
/// Parses a raw byte slice into an [`Identifier`].
///
/// No UTF-8 validation is needed: only a single ASCII byte can form a valid
/// token, and any other byte falls through to an error arm. Dispatches on the
/// byte length first; input longer than one byte is rejected as
/// [`ParseError::TooLong`] without inspecting its contents.
///
/// Length is measured in *bytes*: a multi-byte non-ASCII character (e.g. `'é'`,
/// two bytes) therefore yields [`ParseError::TooLong`], whereas a single
/// non-letter byte yields [`ParseError::InvalidLetter`]. Both are correct
/// rejections; only the reported variant differs.
pub const
/// `<abbr>`: a lone abbreviation letter, whose case carries the side.
const