pub enum TokenType {
Error(Error),
Literal(Literal),
Identifier(SmolStr),
Comment(Comment),
Keyword(Keyword),
PartialKeyword(PartialKeyword),
Symbol(Symbol),
Operator(Operator),
CompoundOperator(CompoundOperator),
EndOfFile,
}Expand description
All token types.
Variants§
Error(Error)
An unknown type.
Literal(Literal)
A luau literal
Identifier(SmolStr)
An identifier, like a variable name.
Comment(Comment)
A comment
Keyword(Keyword)
A luau-reserved-keyword
PartialKeyword(PartialKeyword)
A word that can both be a keyword and an identifier.
Symbol(Symbol)
Symbols like ( and ).
Operator(Operator)
Operators like + and and
CompoundOperator(CompoundOperator)
Compound operators like += and //=
EndOfFile
The end of file token.
Implementations§
Trait Implementations§
Source§impl From<CompoundOperator> for TokenType
impl From<CompoundOperator> for TokenType
Source§fn from(value: CompoundOperator) -> TokenType
fn from(value: CompoundOperator) -> TokenType
Converts to this type from the input type.
Source§impl From<PartialKeyword> for TokenType
impl From<PartialKeyword> for TokenType
Source§fn from(value: PartialKeyword) -> TokenType
fn from(value: PartialKeyword) -> TokenType
Converts to this type from the input type.
Source§impl Ord for TokenType
impl Ord for TokenType
Source§impl PartialOrd for TokenType
impl PartialOrd for TokenType
impl Eq for TokenType
impl StructuralPartialEq for TokenType
Auto Trait Implementations§
impl Freeze for TokenType
impl RefUnwindSafe for TokenType
impl Send for TokenType
impl Sync for TokenType
impl Unpin for TokenType
impl UnwindSafe for TokenType
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