#[repr(u16)]pub enum CmdTokenType {
Show 15 variants
Whitespace = 0,
Newline = 1,
Comment = 2,
StringLiteral = 3,
Variable = 4,
NumberLiteral = 5,
Identifier = 6,
Keyword = 7,
Operator = 8,
Delimiter = 9,
Command = 10,
Label = 11,
Text = 12,
Error = 13,
Eof = 14,
}Expand description
Represents all possible token kinds in the Windows Command (CMD) scripting language.
Variants§
Whitespace = 0
Whitespace characters
Newline = 1
Newline characters
Comment = 2
Comments (starting with REM or ::)
StringLiteral = 3
String literals
Variable = 4
Variable references (e.g., %VAR%)
NumberLiteral = 5
Numeric literals
Identifier = 6
Identifiers
Keyword = 7
CMD keywords (IF, FOR, SET, etc.)
Operator = 8
Operators (==, EQU, NEQ, etc.)
Delimiter = 9
Delimiters
Command = 10
Command names
Label = 11
Labels (starting with :)
Text = 12
Plain text content
Error = 13
Error token
Eof = 14
End of file marker
Trait Implementations§
Source§impl Clone for CmdTokenType
impl Clone for CmdTokenType
Source§fn clone(&self) -> CmdTokenType
fn clone(&self) -> CmdTokenType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CmdTokenType
impl Debug for CmdTokenType
Source§impl<'de> Deserialize<'de> for CmdTokenType
impl<'de> Deserialize<'de> for CmdTokenType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<CmdTokenType> for CmdElementType
impl From<CmdTokenType> for CmdElementType
Source§fn from(token: CmdTokenType) -> Self
fn from(token: CmdTokenType) -> Self
Converts to this type from the input type.
Source§impl Hash for CmdTokenType
impl Hash for CmdTokenType
Source§impl Ord for CmdTokenType
impl Ord for CmdTokenType
Source§fn cmp(&self, other: &CmdTokenType) -> Ordering
fn cmp(&self, other: &CmdTokenType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CmdTokenType
impl PartialEq for CmdTokenType
Source§impl PartialOrd for CmdTokenType
impl PartialOrd for CmdTokenType
Source§impl Serialize for CmdTokenType
impl Serialize for CmdTokenType
Source§impl TokenType for CmdTokenType
impl TokenType for CmdTokenType
Source§const END_OF_STREAM: Self = Self::Eof
const END_OF_STREAM: Self = Self::Eof
A constant representing the end of the input stream.
Source§type Role = UniversalTokenRole
type Role = UniversalTokenRole
The associated role type for this token kind.
Source§fn is_ignored(&self) -> bool
fn is_ignored(&self) -> bool
Returns true if this token represents trivia (whitespace, comments, etc.).
Source§fn is_comment(&self) -> bool
fn is_comment(&self) -> bool
Returns true if this token represents a comment.
Source§fn is_whitespace(&self) -> bool
fn is_whitespace(&self) -> bool
Returns true if this token represents whitespace.
Source§fn is_role(&self, role: Self::Role) -> bool
fn is_role(&self, role: Self::Role) -> bool
Returns true if this token matches the specified language-specific role.
Source§fn is_universal(&self, role: UniversalTokenRole) -> bool
fn is_universal(&self, role: UniversalTokenRole) -> bool
Returns true if this token matches the specified universal role.
Source§fn is_end_of_stream(&self) -> bool
fn is_end_of_stream(&self) -> bool
Returns true if this token represents the end of the input stream.
impl Copy for CmdTokenType
impl Eq for CmdTokenType
impl StructuralPartialEq for CmdTokenType
Auto Trait Implementations§
impl Freeze for CmdTokenType
impl RefUnwindSafe for CmdTokenType
impl Send for CmdTokenType
impl Sync for CmdTokenType
impl Unpin for CmdTokenType
impl UnsafeUnpin for CmdTokenType
impl UnwindSafe for CmdTokenType
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