From: Jérémie Astor Date: Sat, 9 May 2020 20:27:10 +0000 (+0200) Subject: Revert ":art: Allow per nspc operator" X-Git-Tag: nightly~1603 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=fd69b9c44c3170fe557c7932e59c0b62408ffd84;p=gwion.git Revert ":art: Allow per nspc operator" This reverts commit 97efe195d7dfe4d011707e25d3896aaa72e1e44c. --- diff --git a/src/parse/operator.c b/src/parse/operator.c index 49c2eba0..15c2bdd7 100644 --- a/src/parse/operator.c +++ b/src/parse/operator.c @@ -128,12 +128,14 @@ ANN static m_bool op_exist(const struct OpChecker* ock, const Nspc n) { } ANN m_bool add_op(const Gwion gwion, const struct Op_Import* opi) { - const Nspc nspc = gwion->env->curr; + Nspc n = gwion->env->curr; + do { + struct OpChecker ock = { gwion->env, &n->info->op_map, opi, 0 }; + CHECK_BB(op_exist(&ock, n)) + } while((n = n->parent)); + if(!gwion->env->curr->info->op_map.ptr) + map_init(&gwion->env->curr->info->op_map); struct OpChecker ock = { gwion->env, &gwion->env->curr->info->op_map, opi, 0 }; - if(!nspc->info->op_map.ptr) - map_init(&nspc->info->op_map); - else - CHECK_BB(op_exist(&ock, nspc)) const Vector v = op_vector(gwion->mp, &ock); const M_Operator* mo = new_mo(gwion->mp, opi); vector_add(v, (vtype)mo);