-Subproject commit 83f857146706db6c97b5489152cded2be8083852
+Subproject commit 1279070bc5b6fe3ed22bef485c5e66bd85f50da7
-Subproject commit 2e1dfca4383f2672dc524ca999a1c014a24f503c
+Subproject commit 03d98cb98e0f51492f1b0e569debc01ddabd2167
return GW_OK;
}
-ANN static m_bool emit_prim_str(const Emitter emit, const m_str *str) {
+ANN static m_bool emit_prim_str(const Emitter emit, const struct AstString *str) {
const Value v = prim_self(str)->value;
if (!v->d.obj) {
- char c[strlen(*str) + 1];
- if (strlen(*str)) {
- strcpy(c, *str);
- CHECK_BB(escape_str(emit, c, prim_pos(str)));
+ const size_t sz = strlen(str->data);
+ char c[sz + 1];
+ if (sz) {
+ strcpy(c, str->data);
+ CHECK_BB(escape_str(emit, c, prim_pos(str->data)));
;
} else
c[0] = '\0';
return env->gwion->type[et_bool]; \
}
-opck_str(eq, !strcmp(bin->lhs->d.prim.d.str, bin->rhs->d.prim.d.str))
- opck_str(neq, strcmp(bin->lhs->d.prim.d.str, bin->rhs->d.prim.d.str))
+opck_str(eq, !strcmp(bin->lhs->d.prim.d.string.data, bin->rhs->d.prim.d.string.data))
+ opck_str(neq, strcmp(bin->lhs->d.prim.d.string.data, bin->rhs->d.prim.d.string.data))
static CTOR(string_ctor) {
STRING(o) = _mp_calloc(shred->info->mp, 1);
ID_CHECK(check_funcpp) {
((Exp_Primary *)prim)->prim_type = ae_prim_str;
- ((Exp_Primary *)prim)->d.str = env->func ? env->func->name
+ ((Exp_Primary *)prim)->d.string.data = env->func ? env->func->name
: env->class_def ? env->class_def->name
: env->name;
- ((Exp_Primary *)prim)->value = global_string(env, prim->d.str);
+// handle delim?
+ ((Exp_Primary *)prim)->value = global_string(env, prim->d.string.data);
return prim->value->type;
}
return v->type;
}
-ANN Type check_prim_str(const Env env, const m_str *data) {
+ANN Type check_prim_str(const Env env, const struct AstString *data) {
if (!prim_self(data)->value)
- prim_self(data)->value = global_string(env, *data);
+ prim_self(data)->value = global_string(env, data->data);
return env->gwion->type[et_string]; // prim->value
}