diff options
| author | Ginger Bill <bill@gingerbill.org> | 2016-11-28 20:39:43 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2016-11-28 20:39:43 +0000 |
| commit | 598dab5bc4fb2836c8f2a6cad757dcb3760a895f (patch) | |
| tree | 957f92585cae2e41bee93ce0b9d493b5178a0f54 /src/checker/checker.c | |
| parent | cbb70c78731b9d928508a52180a186b178d30a5e (diff) | |
#rune "" to ''; Remove infix and postfix call notation
Diffstat (limited to 'src/checker/checker.c')
| -rw-r--r-- | src/checker/checker.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/checker/checker.c b/src/checker/checker.c index ccd97cad3..e42e6126e 100644 --- a/src/checker/checker.c +++ b/src/checker/checker.c @@ -271,8 +271,9 @@ CycleChecker *cycle_checker_add(CycleChecker *cc, Entity *e) { if (cc->path.e == NULL) { array_init(&cc->path, heap_allocator()); } - GB_ASSERT(e != NULL && e->kind == Entity_TypeName); - array_add(&cc->path, e); + if (e != NULL && e->kind == Entity_TypeName) { + array_add(&cc->path, e); + } return cc; } @@ -508,6 +509,11 @@ void add_global_constant(gbAllocator a, String name, Type *type, ExactValue valu } +void add_global_string_constant(gbAllocator a, String name, String value) { + add_global_constant(a, name, t_untyped_string, make_exact_value_string(value)); + +} + void init_universal_scope(void) { // NOTE(bill): No need to free these @@ -528,9 +534,11 @@ void init_universal_scope(void) { add_global_entity(make_entity_nil(a, str_lit("nil"), t_untyped_nil)); - add_global_constant(a, str_lit("ODIN_OS"), t_untyped_string, make_exact_value_string(str_lit("windows"))); - add_global_constant(a, str_lit("ODIN_ARCH"), t_untyped_string, make_exact_value_string(str_lit("amd64"))); - add_global_constant(a, str_lit("ODIN_VERSION"), t_untyped_string, make_exact_value_string(str_lit(VERSION_STRING))); + add_global_string_constant(a, str_lit("ODIN_OS"), str_lit("windows")); + add_global_string_constant(a, str_lit("ODIN_ARCH"), str_lit("amd64")); + add_global_string_constant(a, str_lit("ODIN_VENDOR"), str_lit("odin")); + add_global_string_constant(a, str_lit("ODIN_VERSION"), str_lit(VERSION_STRING)); + add_global_string_constant(a, str_lit("ODIN_ENDIAN"), str_lit("little")); // Builtin Procedures |