SeraphScript/src/parsing/lex_tokens.rs

139 lines
2.3 KiB
Rust

use crate::defines::{LiteralFloat, LiteralInt};
#[derive(PartialEq, Debug)]
pub enum LexToken {
EndOfFile,
WhiteSpace,
Identifier(String),
IntegerLiteral(LiteralInt),
FloatLiteral(LiteralFloat),
StringLiteral(String),
Semicolon,
Colon,
OpenBracket,
CloseBracket,
OpenCurlyBracket,
CloseCurlyBracket,
OpenBlockBracket,
CloseBlockBracket,
// Keywords
AndKeyword,
AbstractKeyword,
AutoKeyword,
BoolKeyword,
BreakKeyword,
CaseKeyword,
CastKeyword,
CatchKeyword,
ClassKeyword,
ConstKeyword,
ContinueKeyword,
DefaultKeyword,
DoKeyword,
DoubleKeyword,
ElseKeyword,
EnumKeyword,
ExplicitKeyword,
ExternalKeyword,
FalseKeyword,
FinalKeyword,
FloatKeyword,
ForKeyword,
FromKeyword,
FuncDefKeyword,
FunctionKeyword,
GetKeyword,
IfKeyword,
ImportKeyword,
InKeyword,
InOutKeyword,
IntKeyword,
InterfaceKeyword,
Int8Keyword,
Int16Keyword,
Int32Keyword,
Int64Keyword,
IsKeyword,
MixinKeyword,
NamespaceKeyword,
NotKeyword,
NullKeyword,
OrKeyword,
OutKeyword,
OverrideKeyword,
PrivateKeyword,
PropertyKeyword,
ProtectedKeyword,
ReturnKeyword,
SetKeyword,
SharedKeyword,
SuperKeyword,
SwitchKeyword,
ThisKeyword,
TrueKeyword,
TryKeyword,
TypeDefKeyword,
UintKeyword,
Uint8Keyword,
Uint16Keyword,
Uint32Keyword,
Uint64Keyword,
VoidKeyword,
WhileKeyword,
XorKeyword,
// AssignOp
Equals,
PlusEquals,
MinusEquals,
StarEquals,
SlashEquals,
LineEquals,
AmpersandEquals,
RoofEquals,
PercentEquals,
StarStarEquals,
LeftLeftEquals,
RightRightEquals,
RightRightRightEquals,
// LogicOp
AmpersandAmpersand,
LineLine,
RoofRoof,
// CompOp
EqualsEquals,
NotEquals,
NotIsKeyword,
GreaterThan,
GreaterThanEquals,
LessThan,
LessThanEquals,
// MathOp
Plus,
Minus,
Star,
Slash,
Percent,
StarStar,
// BitOp
Ampersand,
VerticalLine,
Roof,
LeftLeft,
RightRight,
RightRightRight,
// ExprPreOp
ExclamationMark,
PlusPlus,
MinusMinus,
Tilde,
AtSymbol,
}