Files
brolang/compiler/token/token.odin
T
2026-06-23 18:24:35 +02:00

84 lines
1.1 KiB
Odin

package token
import "../source"
import "../symbol"
Kind :: enum u8 {
Invalid,
Eof,
Newline,
Identifier,
Integer,
Float,
String,
Character,
Underscore,
Colon_Colon,
Equal,
Plus,
Minus,
Dot,
Range,
At,
Star,
Ampersand,
Caret,
Question,
Semicolon,
Left_Bracket,
Right_Bracket,
Left_Paren,
Right_Paren,
Left_Brace,
Right_Brace,
Comma,
Keyword_Func,
Keyword_C_Func,
Keyword_Struct,
Keyword_C_Struct,
Keyword_Import,
Keyword_Return,
Keyword_Mut,
Keyword_None,
Keyword_Orelse,
Keyword_Void,
Keyword_Int,
Keyword_I8,
Keyword_I16,
Keyword_I32,
Keyword_I64,
Keyword_U8,
Keyword_U16,
Keyword_U32,
Keyword_U64,
Keyword_Isize,
Keyword_Usize,
Keyword_F32,
Keyword_F64,
Keyword_C_Char,
Keyword_C_Schar,
Keyword_C_Uchar,
Keyword_C_Short,
Keyword_C_Ushort,
Keyword_C_Int,
Keyword_C_Uint,
Keyword_C_Long,
Keyword_C_Ulong,
Keyword_C_Longlong,
Keyword_C_Ulonglong,
Keyword_C_Float,
Keyword_C_Double,
Keyword_C_Longdouble,
}
Token :: struct {
span: source.Span,
symbol: symbol.Id,
diagnostic: source.Diagnostic_Id,
kind: Kind,
}
Stream :: struct {
items: [dynamic]Token,
}