aboutsummaryrefslogtreecommitdiff
path: root/src/compile
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-05 18:05:07 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-05 18:05:07 -0400
commitc74fba540448f1d4b1aec4de8f3d9ffc395fdde0 (patch)
tree67f2f62e2ccf1889ebbeef725a6782b8ba9f5912 /src/compile
parent398d2cab6988e20c59e7037ff7ef551540339abb (diff)
Deprecate `deserialize` keyword and `.serialized()` method
Diffstat (limited to 'src/compile')
-rw-r--r--src/compile/expressions.c13
-rw-r--r--src/compile/functions.c11
2 files changed, 0 insertions, 24 deletions
diff --git a/src/compile/expressions.c b/src/compile/expressions.c
index 5ec90191..fcd1d136 100644
--- a/src/compile/expressions.c
+++ b/src/compile/expressions.c
@@ -205,19 +205,6 @@ Text_t compile(env_t *env, ast_t *ast) {
case Lambda: return compile_lambda(env, ast);
case MethodCall: return compile_method_call(env, ast);
case FunctionCall: return compile_function_call(env, ast);
- case Deserialize: {
- ast_t *value = Match(ast, Deserialize)->value;
- type_t *value_type = get_type(env, value);
- if (!type_eq(value_type, Type(ListType, Type(ByteType))))
- code_err(value, "This value should be a list of bytes, not a ", type_to_text(value_type));
- type_t *t = parse_type_ast(env, Match(ast, Deserialize)->type);
- return Texts("({ ", compile_declaration(t, Text("deserialized")),
- ";\n"
- "generic_deserialize(",
- compile(env, value), ", &deserialized, ", compile_type_info(t),
- ");\n"
- "deserialized; })");
- }
case ExplicitlyTyped: {
return compile_to_type(env, Match(ast, ExplicitlyTyped)->ast, get_type(env, ast));
}
diff --git a/src/compile/functions.c b/src/compile/functions.c
index ab267e2c..e1b9c89a 100644
--- a/src/compile/functions.c
+++ b/src/compile/functions.c
@@ -567,10 +567,6 @@ static void add_closed_vars(Table_t *closed_vars, env_t *enclosing_scope, env_t
add_closed_vars(closed_vars, enclosing_scope, env, Match(ast, Assert)->message);
break;
}
- case Deserialize: {
- add_closed_vars(closed_vars, enclosing_scope, env, Match(ast, Deserialize)->value);
- break;
- }
case ExplicitlyTyped: {
add_closed_vars(closed_vars, enclosing_scope, env, Match(ast, ExplicitlyTyped)->ast);
break;
@@ -805,13 +801,6 @@ public
Text_t compile_method_call(env_t *env, ast_t *ast) {
DeclareMatch(call, ast, MethodCall);
type_t *self_t = get_type(env, call->self);
-
- if (streq(call->name, "serialized")) {
- if (call->args) code_err(ast, ".serialized() doesn't take any arguments");
- return Texts("generic_serialize((", compile_declaration(self_t, Text("[1]")), "){", compile(env, call->self),
- "}, ", compile_type_info(self_t), ")");
- }
-
type_t *self_value_t = value_type(self_t);
if (self_value_t->tag == TypeInfoType || self_value_t->tag == ModuleType) {
return compile(env, WrapAST(ast, FunctionCall,