#[repr(u16)]pub enum BatTokenType {
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 Batch (BAT) 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%, !VAR!)
NumberLiteral = 5
Numeric literals
Identifier = 6
Identifiers
Keyword = 7
Batch 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 BatTokenType
impl Clone for BatTokenType
Source§fn clone(&self) -> BatTokenType
fn clone(&self) -> BatTokenType
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 BatTokenType
impl Debug for BatTokenType
Source§impl<'de> Deserialize<'de> for BatTokenType
impl<'de> Deserialize<'de> for BatTokenType
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<BatTokenType> for BatElementType
impl From<BatTokenType> for BatElementType
Source§fn from(token: BatTokenType) -> Self
fn from(token: BatTokenType) -> Self
Converts to this type from the input type.
Source§impl Hash for BatTokenType
impl Hash for BatTokenType
Source§impl Ord for BatTokenType
impl Ord for BatTokenType
Source§fn cmp(&self, other: &BatTokenType) -> Ordering
fn cmp(&self, other: &BatTokenType) -> 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 BatTokenType
impl PartialEq for BatTokenType
Source§impl PartialOrd for BatTokenType
impl PartialOrd for BatTokenType
Source§impl Serialize for BatTokenType
impl Serialize for BatTokenType
Source§impl TokenType for BatTokenType
impl TokenType for BatTokenType
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 BatTokenType
impl Eq for BatTokenType
impl StructuralPartialEq for BatTokenType
Auto Trait Implementations§
impl Freeze for BatTokenType
impl RefUnwindSafe for BatTokenType
impl Send for BatTokenType
impl Sync for BatTokenType
impl Unpin for BatTokenType
impl UnsafeUnpin for BatTokenType
impl UnwindSafe for BatTokenType
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