diff --git a/core_codegen_c_language.cpp b/core_codegen_c_language.cpp index 07fe335..7fdc5d0 100644 --- a/core_codegen_c_language.cpp +++ b/core_codegen_c_language.cpp @@ -49,15 +49,6 @@ unique_name(Allocator *allocator, Ast *ast){ return result; } -// @todo: Gen complicated decl -//array 10 ( pointer (pointer array 5 int a)) -// int (*(*(a[5])))[10] -// -// 1 Get to the bottom -// 2 Add variable name -// 3 Going backwards add arrays and pointers in parens -// 4 Add type name on the left side - function String string_simple_decl_prefix(Allocator *a, Ast_Type *ast){ switch(ast->kind){ @@ -200,7 +191,9 @@ gen_value(Token *pos, Value a){ case TYPE_STRING: gen("(String){(U8 *)\"%Q\", %d}", a.intern_val, a.intern_val.len); break; - CASE_BOOL: a.bool_val ? gen("true"):gen("false"); break; + CASE_BOOL: { + a.bool_val ? gen("true"):gen("false"); + }break; CASE_FLOAT: { String postfix = get_type_postfix(type); gen("%f%Q", a.f64_val, postfix); @@ -746,8 +739,8 @@ typedef U64 SizeU; typedef S64 SizeS; typedef float F32; typedef double F64; -typedef S32 Bool; -typedef S64 Type; +typedef S32 Bool; +typedef S64 Type; #define true 1 #define false 0 #define assert(x) do{if(!(x))__debugbreak();}while(0) diff --git a/core_types.h b/core_types.h index 679f09f..3106ce0 100644 --- a/core_types.h +++ b/core_types.h @@ -138,7 +138,7 @@ const SizeU pointer_align = __alignof(SizeU); global Ast_Type type__void = {TYPE_VOID}; global Ast_Type type__string = {TYPE_STRING, sizeof(String), __alignof(String)}; global Ast_Type type__bool = {TYPE_BOOL, sizeof(bool), __alignof(bool)}; -global Ast_Type type__type = {TYPE_TYPE, sizeof(U32), __alignof(U32)}; +global Ast_Type type__type = {TYPE_TYPE, sizeof(S64), __alignof(S64)}; global Ast_Type type__f32 = {TYPE_F32, sizeof(F32), __alignof(F32)}; global Ast_Type type__f64 = {TYPE_F64, sizeof(F64), __alignof(F64)};