Refactor lexer header to include additional token types and integer literal structure
This commit is contained in:
parent
a7d2b1c421
commit
2e5887b6c9
|
|
@ -13,6 +13,7 @@ typedef enum {
|
||||||
TOKEN_IDENTIFIER,
|
TOKEN_IDENTIFIER,
|
||||||
TOKEN_INTEGER,
|
TOKEN_INTEGER,
|
||||||
TOKEN_FLOAT,
|
TOKEN_FLOAT,
|
||||||
|
TOKEN_DOUBLE,
|
||||||
TOKEN_STRING,
|
TOKEN_STRING,
|
||||||
TOKEN_BOOLEAN,
|
TOKEN_BOOLEAN,
|
||||||
TOKEN_ARRAY,
|
TOKEN_ARRAY,
|
||||||
|
|
@ -20,9 +21,25 @@ typedef enum {
|
||||||
TOKEN_TYPE_TUPLE,
|
TOKEN_TYPE_TUPLE,
|
||||||
} TokenType;
|
} TokenType;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
INTEGER_I64,
|
||||||
|
INTEGER_I32,
|
||||||
|
INTEGER_I16,
|
||||||
|
INTEGER_I8,
|
||||||
|
INTEGER_U64,
|
||||||
|
INTEGER_U32,
|
||||||
|
INTEGER_U16,
|
||||||
|
INTEGER_U8,
|
||||||
|
} IntegerBuiltInType;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
uint8_t is_literal;
|
uint8_t is_literal;
|
||||||
} Identifier;
|
} Identifier;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint64_t value;
|
||||||
|
IntegerBuiltInType type;
|
||||||
|
} IntegerLiteral;
|
||||||
|
|
||||||
#endif // SLS_LEXER_H
|
#endif // SLS_LEXER_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue