Added character token type

This commit is contained in:
Kyler Olsen 2025-11-14 17:20:09 -07:00
parent 87ba892839
commit db14867474
2 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,7 @@ typedef enum {
TOKEN_INTEGER,
TOKEN_FLOAT,
TOKEN_DOUBLE,
TOKEN_CHARACTER,
TOKEN_STRING,
TOKEN_BOOLEAN,
TOKEN_ARRAY,
@ -48,6 +49,7 @@ typedef enum {
ARRAY_U8,
ARRAY_FLOAT,
ARRAY_DOUBLE,
ARRAY_CHARACTER,
ARRAY_STRING,
ARRAY_BOOLEAN,
ARRAY_STRUCT_INLINE,
@ -104,6 +106,7 @@ typedef struct ArrayLiteral {
uint64_t *integer_literals; // type in { ARRAY_I64, ARRAY_I32, ARRAY_I16, ARRAY_I8, ARRAY_U64, ARRAY_U32, ARRAY_U16, ARRAY_U8, }
float *float_literals; // type == ARRAY_FLOAT
double *double_literals; // type == ARRAY_DOUBLE
uint8_t *character_literal; // type == ARRAY_CHARACTER
SlsStr *string_literals; // type == ARRAY_STRING
Boolean *boolean_literals; // type == ARRAY_BOOLEAN
TokenString *token_strings; // type == ARRAY_TOKEN_STRING
@ -121,6 +124,7 @@ struct Token {
IntegerLiteral integer_literal; // type == TOKEN_INTEGER
float float_literal; // type == TOKEN_FLOAT
double double_literal; // type == TOKEN_DOUBLE
uint8_t character_literal; // type == TOKEN_CHARACTER
SlsStr string_literal; // type == TOKEN_STRING
Boolean boolean_literal; // type == TOKEN_BOOLEAN
ArrayLiteral array_literal; // type == TOKEN_ARRAY

View File

@ -24,6 +24,7 @@ const char *TOKEN_TYPES_NAMES[] = {
"Integer",
"Float",
"Double",
"Character",
"String",
"Boolean",
"Array",
@ -43,6 +44,7 @@ const char *ARRAY_TYPES_NAMES[] = {
"u8",
"Float",
"Double",
"Character",
"String",
"Boolean",
"Inline Struct",