Skip to content

Commit 2731a86

Browse files
Remove duplicate decl_type_name in interpreter.c (closes #207)
1 parent a3f5add commit 2731a86

3 files changed

Lines changed: 3 additions & 26 deletions

File tree

src/builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ static void jb_append_json_string(JsonBuf *jb, const char *s) {
12581258
jb_append_char(jb, '"');
12591259
}
12601260

1261-
static const char *decl_type_name(DeclType dt) {
1261+
const char *decl_type_name(DeclType dt) {
12621262
switch (dt) {
12631263
case TYPE_BOOL:
12641264
return "BOOL";

src/builtins.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ int builtins_register_operator(const char *name, BuiltinImplFn impl, int min_arg
3939
// Remove all runtime-registered operators.
4040
void builtins_reset_dynamic(void);
4141

42+
const char *decl_type_name(DeclType dt);
43+
4244
#endif // BUILTINS_H

src/interpreter.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,31 +1041,6 @@ int value_truthiness(Value v) {
10411041
}
10421042
}
10431043

1044-
// ============ Type conversion helpers ============
1045-
1046-
static const char *decl_type_name(DeclType dt) {
1047-
switch (dt) {
1048-
case TYPE_BOOL:
1049-
return "BOOL";
1050-
case TYPE_INT:
1051-
return "INT";
1052-
case TYPE_FLT:
1053-
return "FLT";
1054-
case TYPE_STR:
1055-
return "STR";
1056-
case TYPE_TNS:
1057-
return "TNS";
1058-
case TYPE_MAP:
1059-
return "MAP";
1060-
case TYPE_FUNC:
1061-
return "FUNC";
1062-
case TYPE_THR:
1063-
return "THR";
1064-
default:
1065-
return "UNKNOWN";
1066-
}
1067-
}
1068-
10691044
/* `decl_type_to_value` removed: inverse mapping was unused. */
10701045

10711046
static Value value_with_base(Value v, int base) {

0 commit comments

Comments
 (0)