| 20 | } |
| 21 | |
| 22 | static CBMScopeChunk* alloc_chunk(CBMScope* scope) { |
| 23 | if (!scope->arena) { |
| 24 | return NULL; |
| 25 | } |
| 26 | CBMScopeChunk* c = (CBMScopeChunk*)cbm_arena_alloc(scope->arena, sizeof(CBMScopeChunk)); |
| 27 | if (!c) { |
| 28 | return NULL; |
| 29 | } |
| 30 | memset(c, 0, sizeof(CBMScopeChunk)); |
| 31 | c->next = scope->chunks; |
| 32 | scope->chunks = c; |
| 33 | return c; |
| 34 | } |
| 35 | |
| 36 | void cbm_scope_bind(CBMScope* scope, const char* name, const CBMType* type) { |
| 37 | if (!scope || !name) { |
no test coverage detected