diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-28 13:07:34 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-28 13:07:34 +0200 |
| commit | 61190b56be38a0a39fc37307a9fbfce759b505c3 (patch) | |
| tree | 9c0c71c70d78aa94cf85c95130573cff330bdb6e | |
| parent | 43614694706ac61b2cebef486b7fa9368c78fe6a (diff) | |
Remove dead token/symbol types and fix SYM_INLINEFUNCTION latent error
- Remove IS_A_FUNCTION/IS_NOT_A_FUNCTION macros from symbol.h: referenced
non-existent SYM_INLINEFUNCTION enum value (latent compile error) and
were never used anywhere in the codebase
- Remove TT_BOOL from TokenType enum: marked "temporarily disabled" but
unused for years; YAGNI
- Remove TT_NOTEQ from TokenType enum: duplicate of TT_NEQ ("!="), never
referenced
- Remove IS_NON_TERMINAL/IS_NOT_NON_TERMINAL macros: referenced
START_NON_TERMINALS/END_NON_TERMINALS sentinels that don't exist in the
enum — would cause compile errors if ever used
- Remove token_new_couble declaration (typo) and token_new_double
implementation: function had no callers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | src/core/symbol.h | 2 | ||||
| -rw-r--r-- | src/core/token.c | 11 | ||||
| -rw-r--r-- | src/core/token.h | 6 |
3 files changed, 0 insertions, 19 deletions
diff --git a/src/core/symbol.h b/src/core/symbol.h index e5a331c..fdaac85 100644 --- a/src/core/symbol.h +++ b/src/core/symbol.h @@ -44,8 +44,6 @@ #define symbol_get_val(s) s->p_val #define symbol_get_sym(s) s->sym #define symbol_ref_up(s) ++s->i_refs -#define IS_A_FUNCTION(s) (s == SYM_INLINEFUNCTION || s == SYM_FUNCTION) -#define IS_NOT_A_FUNCTION(s) !IS_A_FUNCTION(s) typedef enum { SYM_BUILDIN, diff --git a/src/core/token.c b/src/core/token.c index 17f98b2..f7cc745 100644 --- a/src/core/token.c +++ b/src/core/token.c @@ -112,7 +112,6 @@ tt_get_name(TokenType tt_cur) { CASE(TT_STRING,"TT_STRING") CASE(TT_ARRAY,"TT_ARRAY") CASE(TT_INTEGER,"TT_INTEGER") - CASE(TT_BOOL,"TT_BOOL") CASE(END_ASSIGNABLES, "END_ASSIGNABLES") CASE(END_NUMERICAL, "END_NUMERICAL") CASE(END_TYPES, "END_TYPES") @@ -176,7 +175,6 @@ tt_get_name(TokenType tt_cur) { CASE(TT_MULT,"TT_MULT") CASE(TT_NEQ,"TT_NEQ") CASE(TT_RE,"TT_RE") - CASE(TT_NOTEQ,"TT_NOTEQ") CASE(TT_SEMICOLON,"TT_SEMICOLON") CASE(TT_SUB,"TT_SUB") CASE(END_OPERATORS, "END_OPERATORS") @@ -235,15 +233,6 @@ token_new_integer(int i_val) { } Token* -token_new_double(double d_val) { - Token *p_token = token_new_dummy(); - token_set_tt(p_token, TT_DOUBLE); - token_set_dval(p_token, d_val); - - return (p_token); -} - -Token* token_new_string(char *c_val) { Token *p_token = token_new_dummy(); token_set_tt(p_token, TT_STRING); diff --git a/src/core/token.h b/src/core/token.h index 1660e7b..497dc78 100644 --- a/src/core/token.h +++ b/src/core/token.h @@ -47,8 +47,6 @@ #define IS_NOT_KEYWORD(t) !IS_KEYWORD(t) #define IS_OPERATOR(t) (START_OPERATORS < t && t < END_OPERATORS) #define IS_NOT_OPERATOR(t) !IS_OPERATOR(t) -#define IS_NON_TERMINAL(t) (START_NON_TERMINALS < t && t < END_NON_TERMINALS) -#define IS_NOT_NON_TERMINAL(t) !IS_NON_TERMINAL(t) #define IS_IDENT(t) (t == TT_IDENT) #define IS_NOT_IDENT(t) !(IS_IDENT(t)) #define IS_ASSIGNABLE(t) (START_ASSIGNABLES < t && t < END_ASSIGNABLES) @@ -78,8 +76,6 @@ typedef enum { // Diverse TT_NONE, TT_END_OF_CODE, - TT_BOOL, // Temporaly disabled, maybe NUMERICAL in future again - // Diverse types START_TERMINALS, START_TYPES, @@ -147,7 +143,6 @@ typedef enum { TT_MULT, TT_NEQ, TT_NOT, - TT_NOTEQ, TT_OR, TT_RE, TT_RSHIFT, @@ -177,7 +172,6 @@ typedef struct { Token* token_new(char *c_val, TokenType tt_cur, int i_line_nr, int i_pos_nr, char *c_filename); Token* token_new_integer(int i_val); -Token* token_new_couble(double d_val); Token* token_new_string(char *c_val); Token* token_new_array(int i_size); Token* token_new_copy(Token *p_token); |
