pub struct TokenFlags(/* private fields */);Expand description
Things about a token that its own bytes do not say.
The two that matter are on every token: whether it started a line, which is how # is
recognised as a directive introducer, and whether anything separated it from the previous
token, which # stringification and -E output both need.
Implementations§
Source§impl TokenFlags
impl TokenFlags
Sourcepub const START_OF_LINE: TokenFlags
pub const START_OF_LINE: TokenFlags
This token is the first on its logical line.
Sourcepub const LEADING_SPACE: TokenFlags
pub const LEADING_SPACE: TokenFlags
Whitespace, a comment, or a line splice came before this token.
Sourcepub const SPLICED: TokenFlags
pub const SPLICED: TokenFlags
The spelling is not the bytes of the span read literally: a line splice or a trigraph sits inside it. Rare enough that everything downstream can take a slow path when it is set, and common enough in real headers that pretending it cannot happen is wrong.
Sourcepub const DIGRAPH: TokenFlags
pub const DIGRAPH: TokenFlags
The punctuator was written in its digraph spelling, <: for [ and so on. The token
means the same thing either way, and -E has to print back what was written.
Sourcepub const EMPTY: TokenFlags
pub const EMPTY: TokenFlags
No flags.
Sourcepub const fn has(self, other: TokenFlags) -> bool
pub const fn has(self, other: TokenFlags) -> bool
Whether every flag in other is set here.
Sourcepub const fn with(self, other: TokenFlags) -> TokenFlags
pub const fn with(self, other: TokenFlags) -> TokenFlags
This set with other added.
Trait Implementations§
Source§impl Clone for TokenFlags
impl Clone for TokenFlags
Source§fn clone(&self) -> TokenFlags
fn clone(&self) -> TokenFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more