diff options
| author | gingerBill <bill@gingerbill.org> | 2017-11-26 18:36:46 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2017-11-26 18:36:46 +0000 |
| commit | 74fa7ca25ddb4c2fc7a600d0089b1a18f6465b69 (patch) | |
| tree | 4814e2e3a8366c388ef867848bfe05a0346d4121 /src/checker.cpp | |
| parent | 5a9223afdac7b97355be6c0441978f12175ede77 (diff) | |
New slice memory layout (ptr+len); `byte`
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 1ba84b5fd..88ad773c0 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -852,6 +852,9 @@ void add_global_string_constant(gbAllocator a, String name, String value) { } +void add_global_type_entity(gbAllocator a, String name, Type *type) { + add_global_entity(make_entity_type_name(a, nullptr, make_token_ident(name), type)); +} @@ -863,17 +866,9 @@ void init_universal_scope(void) { // Types for (isize i = 0; i < gb_count_of(basic_types); i++) { - add_global_entity(make_entity_type_name(a, nullptr, make_token_ident(basic_types[i].Basic.name), &basic_types[i])); + add_global_type_entity(a, basic_types[i].Basic.name, &basic_types[i]); } -#if 1 - // for (isize i = 0; i < gb_count_of(basic_type_aliases); i++) { - // add_global_entity(make_entity_type_name(a, nullptr, make_token_ident(basic_type_aliases[i].Basic.name), &basic_type_aliases[i])); - // } -#else - { - t_byte = add_global_type_alias(a, str_lit("byte"), &basic_types[Basic_u8]); - } -#endif + add_global_type_entity(a, str_lit("byte"), &basic_types[Basic_u8]); // Constants add_global_constant(a, str_lit("true"), t_untyped_bool, exact_value_bool(true)); |