pub enum TokenKind {
Show 66 variants
Number(f64),
String(String),
Regex(String),
Identifier(String),
Begin,
End,
BeginFile,
EndFile,
If,
Else,
While,
For,
Do,
Break,
Continue,
Function,
Return,
Delete,
Exit,
Next,
Nextfile,
Getline,
Print,
Printf,
In,
Plus,
Minus,
Star,
Slash,
Percent,
Caret,
Less,
LessEqual,
Greater,
GreaterEqual,
Equal,
NotEqual,
And,
Or,
Not,
Match,
NotMatch,
Assign,
PlusAssign,
MinusAssign,
StarAssign,
SlashAssign,
PercentAssign,
CaretAssign,
Increment,
Decrement,
Dollar,
Question,
Colon,
Pipe,
Append,
LeftParen,
RightParen,
LeftBrace,
RightBrace,
LeftBracket,
RightBracket,
Semicolon,
Comma,
Newline,
Eof,
}Expand description
All token types in AWK
Variants§
Number(f64)
String(String)
Regex(String)
Identifier(String)
Begin
End
BeginFile
EndFile
If
Else
While
For
Do
Break
Continue
Function
Return
Delete
Exit
Next
Nextfile
Getline
Printf
In
Plus
Minus
Star
Slash
Percent
Caret
Less
LessEqual
Greater
GreaterEqual
Equal
NotEqual
And
Or
Not
Match
NotMatch
Assign
PlusAssign
MinusAssign
StarAssign
SlashAssign
PercentAssign
CaretAssign
Increment
Decrement
Dollar
Question
Colon
Pipe
Append
LeftParen
RightParen
LeftBrace
RightBrace
LeftBracket
RightBracket
Semicolon
Comma
Newline
Eof
Implementations§
Source§impl TokenKind
impl TokenKind
Sourcepub fn is_keyword(&self) -> bool
pub fn is_keyword(&self) -> bool
Check if this token is a keyword
Sourcepub fn can_start_expression(&self) -> bool
pub fn can_start_expression(&self) -> bool
Check if this token can start an expression
Sourcepub fn produces_value(&self) -> bool
pub fn produces_value(&self) -> bool
Check if this token produces a value (for regex vs division disambiguation)
Trait Implementations§
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 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