]> Nishi Git Mirror - gwion.git/commitdiff
:art: Fix find_value
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Tue, 26 Nov 2019 01:36:59 +0000 (02:36 +0100)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Tue, 26 Nov 2019 01:36:59 +0000 (02:36 +0100)
include/env/nspc.h
src/oo/type.c

index cc59e8aaec0cb56f7f907e9e3db83eea8db06693..19c1eb8c065af1449603b39fd912133e98132cd5 100644 (file)
@@ -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) { \
index 6d70d1cb1df96ee1fad9c21b6328b0d76dd0e536..8992127af3ef159145c432b5c8c7a13de3b0527a 100644 (file)
@@ -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;                                                      \
   }                                                                  \