diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-02-07 20:25:48 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-02-07 20:25:48 -0500 |
| commit | 6310f0565641dd64ae435c6a352c76e54fb9ddba (patch) | |
| tree | 1c65dee9dc8e4c7088d0fbe3114bb8da5007acbe | |
| parent | 362146e2955eb48de85d9df04cec549dfe72624a (diff) | |
Remove dead code
| -rw-r--r-- | ast.c | 1 | ||||
| -rw-r--r-- | ast.h | 5 | ||||
| -rw-r--r-- | compile.c | 5 | ||||
| -rw-r--r-- | typecheck.c | 1 |
4 files changed, 1 insertions, 11 deletions
@@ -164,7 +164,6 @@ CORD ast_to_xml(ast_t *ast) T(DocTest, "<DocTest>%r<output>%r</output></DocTest>", optional_tagged("expression", data.expr), xml_escape(data.output)) T(Use, "<Use>%r%r</Use>", optional_tagged("var", data.var), xml_escape(data.path)) T(InlineCCode, "<InlineCode>%r</InlineCode>", xml_escape(data.code)) - T(Serialize, "<Serialize>%r</Serialize>", ast_to_xml(data.value)) T(Deserialize, "<Deserialize><type>%r</type>%r</Deserialize>", type_ast_to_xml(data.type), ast_to_xml(data.value)) default: return "???"; #undef T @@ -146,7 +146,7 @@ typedef enum { DocTest, Use, InlineCCode, - Serialize, Deserialize, + Deserialize, } ast_e; struct ast_s { @@ -330,9 +330,6 @@ struct ast_s { } InlineCCode; struct { ast_t *value; - } Serialize; - struct { - ast_t *value; type_ast_t *type; } Deserialize; } __data; @@ -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 fbee0d07..877d56ab 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 |
