aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-27 13:39:12 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-27 13:39:12 -0500
commitce0e1c25e237849ecd8bea28b5c0ac6112374654 (patch)
treeb9168c1df899edf707714122d1717b0d9026d2e8 /compile.c
parent55d44fe9f235b7916e3184c9a6da8922fd60b056 (diff)
Stop using namespace types
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/compile.c b/compile.c
index fc5fa539..c6d42a2a 100644
--- a/compile.c
+++ b/compile.c
@@ -74,7 +74,7 @@ CORD expr_as_string(env_t *env, CORD expr, type_t *t, CORD color)
case BoolType: return CORD_asprintf("Bool__as_str($stack(%r), %r, NULL)", expr, color);
case IntType: return CORD_asprintf("Int%ld__as_str($stack(%r), %r, NULL)", Match(t, IntType)->bits, expr, color);
case NumType: return CORD_asprintf("Num%ld__as_str($stack(%r), %r, NULL)", Match(t, NumType)->bits, expr, color);
- case StringType: return CORD_asprintf("Str__as_str($stack(%r), %r, &Str.type)", expr, color);
+ case StringType: return CORD_asprintf("Str__as_str($stack(%r), %r, &Str)", expr, color);
case ArrayType: return CORD_asprintf("Array__as_str($stack(%r), %r, %r)", expr, color, compile_type_info(env, t));
case TableType: return CORD_asprintf("Table_as_str($stack(%r), %r, %r)", expr, color, compile_type_info(env, t));
case FunctionType: return CORD_asprintf("Func__as_str($stack(%r), %r, %r)", expr, color, compile_type_info(env, t));
@@ -1014,12 +1014,12 @@ CORD compile(env_t *env, ast_t *ast)
CORD compile_type_info(env_t *env, type_t *t)
{
switch (t->tag) {
- case BoolType: return "&Bool.type";
- case IntType: return CORD_asprintf("&Int%ld.type", Match(t, IntType)->bits);
- case NumType: return CORD_asprintf("&Num%ld.type", Match(t, NumType)->bits);
- case StringType: return CORD_all("&", Match(t, StringType)->dsl ? Match(t, StringType)->dsl : "Str", ".type");
- case StructType: return CORD_all("&", Match(t, StructType)->name, ".type");
- case EnumType: return CORD_all("&", Match(t, EnumType)->name, ".type");
+ case BoolType: return "&Bool";
+ case IntType: return CORD_asprintf("&Int%ld", Match(t, IntType)->bits);
+ case NumType: return CORD_asprintf("&Num%ld", Match(t, NumType)->bits);
+ case StringType: return CORD_all("&", Match(t, StringType)->dsl ? Match(t, StringType)->dsl : "Str");
+ case StructType: return CORD_all("&", Match(t, StructType)->name);
+ case EnumType: return CORD_all("&", Match(t, EnumType)->name);
case ArrayType: {
type_t *item_t = Match(t, ArrayType)->item_type;
return CORD_asprintf("$ArrayInfo(%r)", compile_type_info(env, item_t));
@@ -1041,7 +1041,7 @@ CORD compile_type_info(env_t *env, type_t *t)
case ClosureType: {
errx(1, "No typeinfo for closures yet");
}
- case TypeInfoType: return "&TypeInfo_namespace.type";
+ case TypeInfoType: return "&TypeInfo_info";
default:
compiler_err(NULL, 0, 0, "I couldn't convert to a type info: %T", t);
}