#[repr(u16)]pub enum BashTokenType {
Show 18 variants
Whitespace = 0,
Newline = 1,
Comment = 2,
StringLiteral = 3,
Variable = 4,
NumberLiteral = 5,
Identifier = 6,
Keyword = 7,
Operator = 8,
Delimiter = 9,
Command = 10,
Path = 11,
Heredoc = 12,
GlobPattern = 13,
SpecialChar = 14,
Text = 15,
Error = 16,
Eof = 17,
}Expand description
Represents all possible token kinds in the Bash shell scripting language.
Variants§
Whitespace = 0
Whitespace characters (spaces, tabs)
Newline = 1
Newline characters
Comment = 2
Comments (starting with #)
StringLiteral = 3
String literals enclosed in quotes
Variable = 4
Variable references (e.g., $VAR)
NumberLiteral = 5
Numeric literals
Identifier = 6
Identifiers (variable names, function names, etc.)
Keyword = 7
Bash keywords (if, then, else, etc.)
Operator = 8
Operators (&&, ||, >, <, etc.)
Delimiter = 9
Delimiters (;, (, ), {, }, etc.)
Command = 10
Command names
Path = 11
File system paths
Heredoc = 12
Here documents
GlobPattern = 13
Glob patterns (*, ?, [])
SpecialChar = 14
Special characters with specific meaning
Text = 15
Plain text content
Error = 16
Error token
Eof = 17
End of file marker
Trait Implementations§
Source§impl Clone for BashTokenType
impl Clone for BashTokenType
Source§fn clone(&self) -> BashTokenType
fn clone(&self) -> BashTokenType
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 BashTokenType
impl Debug for BashTokenType
Source§impl<'de> Deserialize<'de> for BashTokenType
impl<'de> Deserialize<'de> for BashTokenType
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<BashTokenType> for BashElementType
impl From<BashTokenType> for BashElementType
Source§fn from(token: BashTokenType) -> Self
fn from(token: BashTokenType) -> Self
Converts to this type from the input type.
Source§impl Hash for BashTokenType
impl Hash for BashTokenType
Source§impl Ord for BashTokenType
impl Ord for BashTokenType
Source§fn cmp(&self, other: &BashTokenType) -> Ordering
fn cmp(&self, other: &BashTokenType) -> 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 BashTokenType
impl PartialEq for BashTokenType
Source§impl PartialOrd for BashTokenType
impl PartialOrd for BashTokenType
Source§impl Serialize for BashTokenType
impl Serialize for BashTokenType
Source§impl TokenType for BashTokenType
impl TokenType for BashTokenType
Source§const END_OF_STREAM: Self = Self::Eof
const END_OF_STREAM: Self = Self::Eof
A constant representing the end of the input stream. Read more
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.). Read more
Source§fn is_comment(&self) -> bool
fn is_comment(&self) -> bool
Returns true if this token represents a comment. Read more
Source§fn is_whitespace(&self) -> bool
fn is_whitespace(&self) -> bool
Returns true if this token represents whitespace. Read more
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_error(&self) -> bool
fn is_error(&self) -> bool
Returns true if this token represents an error condition. Read more
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. Read more
impl Copy for BashTokenType
impl Eq for BashTokenType
impl StructuralPartialEq for BashTokenType
Auto Trait Implementations§
impl Freeze for BashTokenType
impl RefUnwindSafe for BashTokenType
impl Send for BashTokenType
impl Sync for BashTokenType
impl Unpin for BashTokenType
impl UnwindSafe for BashTokenType
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