From e6e0aba8c31f5c9ccec7d0113d63f5104df74ea1 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 10 Sep 2017 15:17:37 +0100 Subject: Remove `when` suffixes; Implement file scope `when` statement, evaluated in source order --- src/check_expr.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/check_expr.cpp') diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 0a361d9d3..db8aef9f9 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -98,7 +98,7 @@ void check_scope_decls(Checker *c, Array nodes, isize reserve_size) { Scope *s = c->context.scope; GB_ASSERT(s->file == nullptr); - check_collect_entities(c, nodes, false); + check_collect_entities(c, nodes); for_array(i, s->elements.entries) { Entity *e = s->elements.entries[i].value; @@ -995,14 +995,14 @@ Array check_fields(Checker *c, AstNode *node, Array decls, array_init(&fields, heap_allocator(), init_field_capacity); Map entity_map = {}; - map_init_with_reserve(&entity_map, c->tmp_allocator, 2*init_field_capacity); + map_init(&entity_map, c->tmp_allocator, 2*init_field_capacity); if (node != nullptr) { GB_ASSERT(node->kind != AstNode_UnionType); } - check_collect_entities(c, decls, false); + check_collect_entities(c, decls); for_array(i, c->context.scope->elements.entries) { Entity *e = c->context.scope->elements.entries[i].value; DeclInfo *d = nullptr; @@ -1442,7 +1442,7 @@ void check_enum_type(Checker *c, Type *enum_type, Type *named_type, AstNode *nod enum_type->Enum.base_type = base_type; Map entity_map = {}; // Key: String - map_init_with_reserve(&entity_map, c->tmp_allocator, 2*(et->fields.count)); + map_init(&entity_map, c->tmp_allocator, 2*(et->fields.count)); Array fields = {}; array_init(&fields, c->allocator, et->fields.count); @@ -1562,7 +1562,7 @@ void check_bit_field_type(Checker *c, Type *bit_field_type, AstNode *node) { defer (gb_temp_arena_memory_end(tmp)); Map entity_map = {}; // Key: String - map_init_with_reserve(&entity_map, c->tmp_allocator, 2*(bft->fields.count)); + map_init(&entity_map, c->tmp_allocator, 2*(bft->fields.count)); isize field_count = 0; Entity **fields = gb_alloc_array(c->allocator, Entity *, bft->fields.count); -- cgit v1.2.3