From: Jérémie Astor Date: Tue, 26 Nov 2019 01:36:59 +0000 (+0100) Subject: :art: Fix find_value X-Git-Tag: nightly~2076^2~8 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=59a722c5939ac1c0ad49bcd8bf3228d1b8ad2bb0;p=gwion.git :art: Fix find_value --- diff --git a/include/env/nspc.h b/include/env/nspc.h index cc59e8aa..19c1eb8c 100644 --- a/include/env/nspc.h +++ b/include/env/nspc.h @@ -28,20 +28,26 @@ extern ANN void nspc_commit(const Nspc); #define describe_lookup0(A, b) \ static inline ANN A nspc_lookup_##b##0(const Nspc n, const Symbol s){ \ - return (A)scope_lookup0(n->info->b, (vtype)s); \ + return (A)scope_lookup0(n->info->b, (vtype)s); \ } #define describe_lookup1(A, b) \ static inline ANN A nspc_lookup_##b##1(const Nspc n, const Symbol s) { \ - const A a = (A)scope_lookup1(n->info->b, (vtype)s); \ + const A a = (A)scope_lookup1(n->info->b, (vtype)s); \ if(!a && n->parent) \ return nspc_lookup_##b##1(n->parent, s); \ return a; \ } +#define describe_lookup2(A, b) \ +static inline ANN A nspc_lookup_##b##2(const Nspc n, const Symbol s) { \ + return (A)scope_lookup1(n->info->b, (vtype)s); \ +} + #define describe_lookups(A, b) \ describe_lookup0(A, b) \ describe_lookup1(A, b) \ +describe_lookup2(A, b) #define describe_nspc_func(A, b) \ static inline ANN void nspc_add_##b(const Nspc n, const Symbol s, const A a) { \ diff --git a/src/oo/type.c b/src/oo/type.c index 6d70d1cb..8992127a 100644 --- a/src/oo/type.c +++ b/src/oo/type.c @@ -76,7 +76,7 @@ ANN Type find_common_anc(const restrict Type lhs, const restrict Type rhs) { #define describe_find(name, t) \ ANN t find_##name(const Type type, const Symbol xid) { \ if(type->nspc) { \ - const t val = nspc_lookup_##name##0(type->nspc, xid); \ + const t val = nspc_lookup_##name##2(type->nspc, xid); \ if(val) \ return val; \ } \