From 6310f0565641dd64ae435c6a352c76e54fb9ddba Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 7 Feb 2025 20:25:48 -0500 Subject: [PATCH] Remove dead code --- ast.c | 1 - ast.h | 5 +---- compile.c | 5 ----- typecheck.c | 1 - 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/ast.c b/ast.c index 23f1409..b960a2e 100644 --- a/ast.c +++ b/ast.c @@ -164,7 +164,6 @@ CORD ast_to_xml(ast_t *ast) T(DocTest, "%r%r", optional_tagged("expression", data.expr), xml_escape(data.output)) T(Use, "%r%r", optional_tagged("var", data.var), xml_escape(data.path)) T(InlineCCode, "%r", xml_escape(data.code)) - T(Serialize, "%r", ast_to_xml(data.value)) T(Deserialize, "%r%r", type_ast_to_xml(data.type), ast_to_xml(data.value)) default: return "???"; #undef T diff --git a/ast.h b/ast.h index 173b317..dbc14ec 100644 --- a/ast.h +++ b/ast.h @@ -146,7 +146,7 @@ typedef enum { DocTest, Use, InlineCCode, - Serialize, Deserialize, + Deserialize, } ast_e; struct ast_s { @@ -328,9 +328,6 @@ struct ast_s { struct type_s *type; type_ast_t *type_ast; } InlineCCode; - struct { - ast_t *value; - } Serialize; struct { ast_t *value; type_ast_t *type; diff --git a/compile.c b/compile.c index f406893..9c1a16f 100644 --- a/compile.c +++ b/compile.c @@ -3376,11 +3376,6 @@ CORD compile(env_t *env, ast_t *ast) code_err(call->fn, "This is not a function, it's a %T", fn_t); } } - case Serialize: { - ast_t *value = Match(ast, Serialize)->value; - type_t *t = get_type(env, value); - return CORD_all("generic_serialize((", compile_declaration(t, "[1]"), "){", compile(env, value), "}, ", compile_type_info(env, t), ")"); - } case Deserialize: { ast_t *value = Match(ast, Deserialize)->value; type_t *value_type = get_type(env, value); diff --git a/typecheck.c b/typecheck.c index fbee0d0..877d56a 100644 --- a/typecheck.c +++ b/typecheck.c @@ -1323,7 +1323,6 @@ type_t *get_type(env_t *env, ast_t *ast) } case Moment: return Type(MomentType); case Unknown: code_err(ast, "I can't figure out the type of: %W", ast); - case Serialize: return Type(ArrayType, Type(ByteType)); case Deserialize: return parse_type_ast(env, Match(ast, Deserialize)->type); } #pragma GCC diagnostic pop