pub enum Item<'a> {
Comm(&'a str),
Str(&'a str),
Sym(&'a str),
Punct(&'a str),
Parens(Seq<'a>),
Brackets(Seq<'a>),
Braces(Seq<'a>),
Prefixed {
sigil: char,
item: Box<Item<'a>>,
},
Run(Vec<Item<'a>>),
}Expand description
A single visually-atomic entity in a chain (<item> in the spec).
Variants§
Comm(&'a str)
A comment, stored raw including its // or /* */ delimiters.
Str(&'a str)
A string literal; the inner slice, between the quotes, undecoded
(escapes are validated but not expanded — see the crate open note).
Sym(&'a str)
A symbol: a maximal run of symchars (identifier, number, operator, …).
Punct(&'a str)
Punctuation: a maximal run of punctchars standing between items (:).
Parens(Seq<'a>)
A parenthesis-wrapped sequence.
Brackets(Seq<'a>)
A bracket-wrapped sequence.
Braces(Seq<'a>)
A brace-wrapped sequence.
Prefixed
An item marked with a leading sigil (&, ., or #).
Run(Vec<Item<'a>>)
A run: two or more atoms written with no whitespace between them, so
they form one chain item (Main.A.S, f(x), (f x).1, 3.14). Members
are in written order; none is itself a Run, a Punct, or a Comm (a
punct or comment ends a run). A lone atom is never wrapped in a Run.