From 3dc89f2fd1705f03b8838e2afce80f691b709d63 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 11 Jan 2026 15:27:56 -0500 Subject: Misc fixes --- src/compile/assertions.c | 2 +- src/compile/optionals.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/compile') diff --git a/src/compile/assertions.c b/src/compile/assertions.c index 18531fd9..7cb202e8 100644 --- a/src/compile/assertions.c +++ b/src/compile/assertions.c @@ -13,7 +13,7 @@ public Text_t compile_assertion(env_t *env, ast_t *ast) { ast_t *expr = Match(ast, Assert)->expr; ast_t *message = Match(ast, Assert)->message; - const char *failure = NULL; + const char *failure = "vs"; switch (expr->tag) { case And: { DeclareMatch(and_, expr, And); diff --git a/src/compile/optionals.c b/src/compile/optionals.c index f54d8931..bf8bf4aa 100644 --- a/src/compile/optionals.c +++ b/src/compile/optionals.c @@ -71,6 +71,7 @@ Text_t compile_none(type_t *t) { case PointerType: return Texts("((", compile_type(t), ")NULL)"); case ClosureType: return Text("NONE_CLOSURE"); case FloatType: return Text("nan(\"none\")"); + case RealType: return Text("NONE_REAL"); case StructType: return Texts("((", compile_type(Type(OptionalType, .type = t)), "){.has_value=false})"); case EnumType: { env_t *enum_env = Match(t, EnumType)->env; @@ -91,6 +92,7 @@ Text_t check_none(type_t *t, Text_t value) { else if (t->tag == ClosureType) return Texts("((", value, ").fn == NULL)"); else if (t->tag == FloatType) return Texts(Match(t, FloatType)->bits == TYPE_NBITS64 ? "Float64$isnan(" : "Float32$isnan(", value, ")"); + else if (t->tag == RealType) return Texts("Real$is_none(", value, ")"); else if (t->tag == ListType) return Texts("((", value, ").data == NULL)"); else if (t->tag == TableType) return Texts("((", value, ").entries.data == NULL)"); else if (t->tag == BoolType) return Texts("((", value, ") == NONE_BOOL)"); -- cgit v1.2.3