diff --git a/builtins/string.h b/builtins/string.h index 48c39ae..f9dc83c 100644 --- a/builtins/string.h +++ b/builtins/string.h @@ -47,6 +47,7 @@ typedef struct { } Str_namespace_t; extern Str_namespace_t Str; +CORD Str__as_str(const void *str, bool colorize, const TypeInfo *info); CORD Str__quoted(CORD str, bool colorize); int Str__compare(CORD *x, CORD *y); bool Str__equal(CORD *x, CORD *y); diff --git a/compile.c b/compile.c index 0496f49..665c646 100644 --- a/compile.c +++ b/compile.c @@ -44,7 +44,7 @@ CORD expr_as_string(env_t *env, CORD expr, type_t *t, CORD color) case BoolType: return CORD_asprintf("Bool__as_str(%r, %r, NULL)", expr, color); case IntType: return CORD_asprintf("Int%ld__as_str(%r, %r, NULL)", Match(t, IntType)->bits, expr, color); case NumType: return CORD_asprintf("Num%ld__as_str(%r, %r, NULL)", Match(t, NumType)->bits, expr, color); - case StringType: return CORD_asprintf("Str__as_str(%r, %r, &Str_type.type)", expr, color); + case StringType: return CORD_asprintf("Str__as_str(%r, %r, &Str.type)", expr, color); case ArrayType: return CORD_asprintf("Array__as_str(%r, %r, %r)", expr, color, compile_type_info(env, t)); case TableType: return CORD_asprintf("Table_as_str(%r, %r, %r)", expr, color, compile_type_info(env, t)); case FunctionType: return CORD_asprintf("Func__as_str(%r, %r, %r)", expr, color, compile_type_info(env, t));