From fd69b9c44c3170fe557c7932e59c0b62408ffd84 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sat, 9 May 2020 22:27:10 +0200 Subject: [PATCH] Revert ":art: Allow per nspc operator" This reverts commit 97efe195d7dfe4d011707e25d3896aaa72e1e44c. --- src/parse/operator.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); -- 2.43.0