From: fennecdjay Date: Wed, 21 Dec 2022 10:42:40 +0000 (+0100) Subject: :bug: mark some primitive as constants X-Git-Tag: nightly~207^2~27 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=852eb77bf9837efa5612ac2e9309e5aca813fc0b;p=gwion.git :bug: mark some primitive as constants --- diff --git a/src/parse/check.c b/src/parse/check.c index 5c7b9434..6089c281 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -401,6 +401,7 @@ ANN static Type prim_id_non_res(const Env env, const Symbol *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->data, prim_pos(data)); + exp_setmeta(prim_exp(data), true); return env->gwion->type[et_string]; // prim->value } @@ -432,6 +433,7 @@ ANN static Type check_prim_hack(const Env env, const Exp *data) { } ANN static Type check_prim_locale(const Env env, const Symbol *data NUSED) { + exp_setmeta(prim_exp(data), true); return env->gwion->type[et_float]; } @@ -465,6 +467,7 @@ ANN Type check_array_access(const Env env, const Array_Sub array) { static ANN Type check_exp_array(const Env env, const Exp_Array *array) { CHECK_OO((array->array->type = check_exp(env, array->base))); CHECK_BO(check_subscripts(env, array->array, 0)); + if(exp_getmeta(array->base)) exp_setmeta(exp_self(array), true); return check_array_access(env, array->array); }