| 105 | } |
| 106 | |
| 107 | bool cbm_scope_contains(const CBMScope *scope, const char *name) { |
| 108 | if (!name) { |
| 109 | return false; |
| 110 | } |
| 111 | for (const CBMScope *s = scope; s != NULL; s = s->parent) { |
| 112 | for (const CBMScopeChunk *c = s->chunks; c != NULL; c = c->next) { |
| 113 | for (int i = 0; i < c->used; i++) { |
| 114 | if (c->bindings[i].name && strcmp(c->bindings[i].name, name) == 0) { |
| 115 | return true; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | return false; |
| 121 | } |
| 122 | |
| 123 | const char *cbm_scope_lookup_callable(const CBMScope *scope, const char *name) { |
| 124 | if (!name) { |
no outgoing calls
no test coverage detected