Remove dead code

This commit is contained in:
Bruce Hill 2025-02-07 20:25:48 -05:00
parent 362146e295
commit 6310f05656
4 changed files with 1 additions and 11 deletions

1
ast.c
View File

@ -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

5
ast.h
View File

@ -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;

View File

@ -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);

View File

@ -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