aboutsummaryrefslogtreecommitdiff
path: root/src/compile/expressions.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-21 15:14:37 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-21 15:14:37 -0400
commitf5612e38183dc20d18f207f8ab055574a4d93ad0 (patch)
treec2caf5a0311b6d9fd0fbd4c08493dac5981088be /src/compile/expressions.c
parent7f6683269ce689a83b9c6e1fae15e0cc60351095 (diff)
Bugfixes for anonymous enums, code cleanup to remove type_to_string(),
and changed it so anonymous enums show up in doctests with their full type instead of `enum$20`
Diffstat (limited to 'src/compile/expressions.c')
-rw-r--r--src/compile/expressions.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compile/expressions.c b/src/compile/expressions.c
index e888ce16..16b94d73 100644
--- a/src/compile/expressions.c
+++ b/src/compile/expressions.c
@@ -98,7 +98,7 @@ Text_t compile(env_t *env, ast_t *ast) {
else if (t->tag == TextType) return Texts("(", compile(env, value), ".length == 0)");
else if (t->tag == OptionalType) return check_none(t, compile(env, value));
- code_err(ast, "I don't know how to negate values of type ", type_to_str(t));
+ code_err(ast, "I don't know how to negate values of type ", type_to_text(t));
}
case Negative: {
ast_t *value = Match(ast, Negative)->value;
@@ -112,7 +112,7 @@ Text_t compile(env_t *env, ast_t *ast) {
if (t->tag == IntType || t->tag == NumType) return Texts("-(", compile(env, value), ")");
- code_err(ast, "I don't know how to get the negative value of type ", type_to_str(t));
+ code_err(ast, "I don't know how to get the negative value of type ", type_to_text(t));
}
case HeapAllocate:
case StackReference: return compile_typed_allocation(env, ast, get_type(env, ast));
@@ -218,7 +218,7 @@ Text_t compile(env_t *env, ast_t *ast) {
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_str(value_type));
+ 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"