feat(lexer): add token definitions

This commit is contained in:
dualfroz committed 2026-08-23 15:50:00 +02:00
1 parent 9d2c9340f0
commit 3dca55184f
1 file changed
+64
+64
View File
@@ -0,0 +1,64 @@
package lumen.lexer
enum class TokenType {
// literals
IntLiteral,
DoubleLiteral,
StringLiteral,
Identifier,
// keywords
Let,
Var,
Fn,
Return,
If,
Else,
While,
For,
In,
True,
False,
Nil,
And,
Or,
Not,
Import,
// punctuation
Plus,
Minus,
Star,
Slash,
Percent,
Assign,
EqualEqual,
BangEqual,
Less,
LessEqual,
Greater,
GreaterEqual,
LeftParen,
RightParen,
LeftBracket,
RightBracket,
LeftBrace,
RightBrace,
Comma,
Colon,
Semicolon,
Dot,
Newline,
Eof
}
data class Token(
val type: TokenType,
val lexeme: String,
val line: Int,
val column: Int = 1,
val intValue: Long = 0L,
val doubleValue: Double = 0.0,
val stringValue: String = ""
)