Enum TokenType
pub enum TokenType {
Show 48 variants
OpenParen,
CloseParen,
OpenBrace,
CloseBrace,
OpenSqBracket,
CloseSqBracket,
Semicolon,
Colon,
Comma,
BitwiseAnd,
BitwiseOr,
BitwiseNot,
BitwiseXor,
Plus,
Minus,
Multiply,
Divide,
Remainder,
Assignment,
LogicalNot,
LessThan,
GreaterThan,
Ternary,
BitwiseAndAssignment,
BitwiseOrAssignment,
BitwiseXorAssignment,
LeftShiftAssignment,
RightShiftAssignment,
Increment,
Decrement,
AdditionAssignment,
SubtractionAssignment,
MultiplyAssignment,
DivideAssignment,
RemainderAssignment,
LeftShift,
RightShift,
LogicalAnd,
LogicalOr,
EqualTo,
NotEqualTo,
LessThanOrEqualTo,
GreaterThanOrEqualTo,
Identifier(String),
CharLiteral {
literal: String,
is_multichar: bool,
value: i32,
},
IntegerLiteral {
literal: String,
base: NumericLiteralBase,
suffix: Option<IntegerLiteralSuffix>,
},
FloatLiteral {
literal: String,
base: NumericLiteralBase,
suffix: Option<FloatLiteralSuffix>,
},
StringLiteral {
literal: String,
ascii: Vec<String>,
},
}Expand description
Types of tokens produced by lexical analysis.
Variants§
OpenParen
CloseParen
OpenBrace
CloseBrace
OpenSqBracket
CloseSqBracket
Semicolon
Colon
Comma
BitwiseAnd
BitwiseOr
BitwiseNot
BitwiseXor
Plus
Minus
Multiply
Divide
Remainder
Assignment
LogicalNot
LessThan
GreaterThan
Ternary
BitwiseAndAssignment
BitwiseOrAssignment
BitwiseXorAssignment
LeftShiftAssignment
RightShiftAssignment
Increment
Decrement
AdditionAssignment
SubtractionAssignment
MultiplyAssignment
DivideAssignment
RemainderAssignment
LeftShift
RightShift
LogicalAnd
LogicalOr
EqualTo
NotEqualTo
LessThanOrEqualTo
GreaterThanOrEqualTo
Identifier(String)
CharLiteral
IntegerLiteral
FloatLiteral
StringLiteral
Implementations§
§impl TokenType
impl TokenType
pub fn new_identifier(id: &str) -> TokenType
pub fn new_identifier(id: &str) -> TokenType
Makes an identifier token type with the given name.
Trait Implementations§
§impl From<AstAssignmentOp> for TokenType
impl From<AstAssignmentOp> for TokenType
§fn from(op: AstAssignmentOp) -> Self
fn from(op: AstAssignmentOp) -> Self
Converts to this type from the input type.
§impl From<AstBinaryOp> for TokenType
impl From<AstBinaryOp> for TokenType
§fn from(op: AstBinaryOp) -> Self
fn from(op: AstBinaryOp) -> Self
Converts to this type from the input type.
§impl From<AstUnaryOp> for TokenType
impl From<AstUnaryOp> for TokenType
§fn from(op: AstUnaryOp) -> Self
fn from(op: AstUnaryOp) -> Self
Converts to this type from the input type.
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