diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2026-01-11 15:27:56 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2026-01-11 15:27:56 -0500 |
| commit | 3dc89f2fd1705f03b8838e2afce80f691b709d63 (patch) | |
| tree | 17fafdf1a5723c079c4c42cc3459590abdedb4c7 /src/compile | |
| parent | bb4c931fc660eca5cc28f637873386bfb3a6b56b (diff) | |
Misc fixes
Diffstat (limited to 'src/compile')
| -rw-r--r-- | src/compile/assertions.c | 2 | ||||
| -rw-r--r-- | src/compile/optionals.c | 2 |
2 files changed, 3 insertions, 1 deletions
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)"); |
