pub enum TokenKind {
Show 17 variants
FieldName,
Colon,
SectionHeader,
SectionArg,
If,
Else,
Elif,
Value,
Comma,
LParen,
RParen,
Not,
And,
Or,
CompOp,
Comment,
Eof,
}Expand description
The kind of a token.
Variants§
FieldName
An identifier that appears before a :: a field name.
Colon
The : separator after a field name.
SectionHeader
A section keyword: library, executable, test-suite, benchmark,
flag, source-repository, common.
SectionArg
The argument after a section header (e.g. the name in executable foo).
If
The if keyword in a conditional.
Else
The else keyword.
Elif
The elif keyword (rare, but in the spec).
Value
Raw value text (the part after a colon on the same line, or a continuation line that is part of a field value).
Comma
A comma ,.
LParen
(.
RParen
).
Not
! (negation in conditions).
And
&&.
Or
||.
CompOp
A comparison operator: ==, >=, <=, >, <.
Comment
A line comment (starts with --). Stored as trivia on the next
meaningful token, but also emitted as a standalone token when it is the
only content on a line.
Eof
End of file.
Trait Implementations§
impl Copy for TokenKind
impl Eq for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Freeze for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnsafeUnpin for TokenKind
impl UnwindSafe for TokenKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more