diff --git a/SLS_C/include/sls/lexer.h b/SLS_C/include/sls/lexer.h index 6f4089f..988e600 100644 --- a/SLS_C/include/sls/lexer.h +++ b/SLS_C/include/sls/lexer.h @@ -10,6 +10,8 @@ #include "sls_errors.h" +const size_t TYPE_NAMES_SAFE_LENGTH = 20; + typedef struct { const char *filename; const char *source_code; @@ -31,6 +33,19 @@ typedef enum { TOKEN_TYPE_TUPLE, } TokenType; +const char *TOKEN_TYPES_NAMES[] = { + "End of File", + "Identifier", + "Integer", + "Float", + "Double", + "String", + "Boolean", + "Array", + "Token String", + "Type Tuple", +}; + typedef enum { ARRAY_IDENTIFIER, ARRAY_I64, @@ -51,6 +66,26 @@ typedef enum { ARRAY_STRUCT_INLINE, } ArrayType; +const char *ARRAY_TYPES_NAMES[] = { + "Identifier", + "i64", + "i32", + "i16", + "i8", + "u64", + "u32", + "u16", + "u8", + "Float", + "Double", + "String", + "Boolean", + "Array", + "Token String", + "Type Tuple", + "Inline Struct", +}; + typedef struct { const char *name; size_t length; @@ -68,6 +103,17 @@ typedef enum { INTEGER_U8, } IntegerBuiltInType; +const char *INTEGER_TYPES_NAMES[] = { + "i64", + "i32", + "i16", + "i8", + "u64", + "u32", + "u16", + "u8", +}; + typedef struct { uint64_t value; IntegerBuiltInType type; diff --git a/SLS_C/tests/lexer_tests.c b/SLS_C/tests/lexer_tests.c index 3dc0bb6..ad67a6e 100644 --- a/SLS_C/tests/lexer_tests.c +++ b/SLS_C/tests/lexer_tests.c @@ -19,30 +19,6 @@ typedef struct { LexerInfo lexer_info; } LexerTest; -static const char *TOKEN_TYPES_NAMES[] = { - "End of File", - "Identifier", - "Integer", - "Float", - "Double", - "String", - "Boolean", - "Array", - "Token String", - "Type Tuple", -}; - -static const char *INTEGER_TYPES_NAMES[] = { - "i64", - "i32", - "i16", - "i8", - "u64", - "u32", - "u16", - "u8", -}; - typedef struct { const char *value; size_t length;