From dbd7502a1dcee6b99434f39393cb356efa542ddc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 17 Feb 2024 17:29:56 -0500 Subject: Fix up some builtins --- compile.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'compile.c') diff --git a/compile.c b/compile.c index c3dfb723..a230d712 100644 --- a/compile.c +++ b/compile.c @@ -414,4 +414,17 @@ CORD compile(env_t *env, ast_t *ast) return NULL; } +// CORD compile_type_info(env_t *env, type_t *t) +// { +// switch (t->tag) { +// case BoolType: return "&Bool$Info"; +// case IntType: return CORD_asprintf("&Int%ld$Info", Match(t, IntType)->bits); +// case NumType: return CORD_asprintf("&Num%ld$Info", Match(t, NumType)->bits); +// case StringType: return CORD_all("&", Match(t, StringType)->dsl ? Match(t, StringType)->dsl : "Str", "$Info"); +// case StructType: return CORD_all("&", Match(t, StructType)->name, "$Info"); +// case EnumType: return CORD_all("&", Match(t, EnumType)->name, "$Info"); +// case ArrayType: return CORD_all("&((TypeInfo){", Match(t, EnumType)->name, "$Info"); +// } +// } + // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 -- cgit v1.2.3