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_INTEGER,
TOKEN_FLOAT, TOKEN_FLOAT,
TOKEN_DOUBLE, TOKEN_DOUBLE,
TOKEN_CHARACTER,
TOKEN_STRING, TOKEN_STRING,
TOKEN_BOOLEAN, TOKEN_BOOLEAN,
TOKEN_ARRAY, TOKEN_ARRAY,
@ -48,6 +49,7 @@ typedef enum {
ARRAY_U8, ARRAY_U8,
ARRAY_FLOAT, ARRAY_FLOAT,
ARRAY_DOUBLE, ARRAY_DOUBLE,
ARRAY_CHARACTER,
ARRAY_STRING, ARRAY_STRING,
ARRAY_BOOLEAN, ARRAY_BOOLEAN,
ARRAY_STRUCT_INLINE, 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, } 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 float *float_literals; // type == ARRAY_FLOAT
double *double_literals; // type == ARRAY_DOUBLE double *double_literals; // type == ARRAY_DOUBLE
uint8_t *character_literal; // type == ARRAY_CHARACTER
SlsStr *string_literals; // type == ARRAY_STRING SlsStr *string_literals; // type == ARRAY_STRING
Boolean *boolean_literals; // type == ARRAY_BOOLEAN Boolean *boolean_literals; // type == ARRAY_BOOLEAN
TokenString *token_strings; // type == ARRAY_TOKEN_STRING TokenString *token_strings; // type == ARRAY_TOKEN_STRING
@ -121,6 +124,7 @@ struct Token {
IntegerLiteral integer_literal; // type == TOKEN_INTEGER IntegerLiteral integer_literal; // type == TOKEN_INTEGER
float float_literal; // type == TOKEN_FLOAT float float_literal; // type == TOKEN_FLOAT
double double_literal; // type == TOKEN_DOUBLE double double_literal; // type == TOKEN_DOUBLE
uint8_t character_literal; // type == TOKEN_CHARACTER
SlsStr string_literal; // type == TOKEN_STRING SlsStr string_literal; // type == TOKEN_STRING
Boolean boolean_literal; // type == TOKEN_BOOLEAN Boolean boolean_literal; // type == TOKEN_BOOLEAN
ArrayLiteral array_literal; // type == TOKEN_ARRAY ArrayLiteral array_literal; // type == TOKEN_ARRAY

View File

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