Fix wrong type on Type type, heh
This commit is contained in:
@@ -49,15 +49,6 @@ unique_name(Allocator *allocator, Ast *ast){
|
|||||||
return result;
|
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
|
function String
|
||||||
string_simple_decl_prefix(Allocator *a, Ast_Type *ast){
|
string_simple_decl_prefix(Allocator *a, Ast_Type *ast){
|
||||||
switch(ast->kind){
|
switch(ast->kind){
|
||||||
@@ -200,7 +191,9 @@ gen_value(Token *pos, Value a){
|
|||||||
case TYPE_STRING:
|
case TYPE_STRING:
|
||||||
gen("(String){(U8 *)\"%Q\", %d}", a.intern_val, a.intern_val.len);
|
gen("(String){(U8 *)\"%Q\", %d}", a.intern_val, a.intern_val.len);
|
||||||
break;
|
break;
|
||||||
CASE_BOOL: a.bool_val ? gen("true"):gen("false"); break;
|
CASE_BOOL: {
|
||||||
|
a.bool_val ? gen("true"):gen("false");
|
||||||
|
}break;
|
||||||
CASE_FLOAT: {
|
CASE_FLOAT: {
|
||||||
String postfix = get_type_postfix(type);
|
String postfix = get_type_postfix(type);
|
||||||
gen("%f%Q", a.f64_val, postfix);
|
gen("%f%Q", a.f64_val, postfix);
|
||||||
@@ -746,8 +739,8 @@ typedef U64 SizeU;
|
|||||||
typedef S64 SizeS;
|
typedef S64 SizeS;
|
||||||
typedef float F32;
|
typedef float F32;
|
||||||
typedef double F64;
|
typedef double F64;
|
||||||
typedef S32 Bool;
|
typedef S32 Bool;
|
||||||
typedef S64 Type;
|
typedef S64 Type;
|
||||||
#define true 1
|
#define true 1
|
||||||
#define false 0
|
#define false 0
|
||||||
#define assert(x) do{if(!(x))__debugbreak();}while(0)
|
#define assert(x) do{if(!(x))__debugbreak();}while(0)
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ const SizeU pointer_align = __alignof(SizeU);
|
|||||||
global Ast_Type type__void = {TYPE_VOID};
|
global Ast_Type type__void = {TYPE_VOID};
|
||||||
global Ast_Type type__string = {TYPE_STRING, sizeof(String), __alignof(String)};
|
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__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__f32 = {TYPE_F32, sizeof(F32), __alignof(F32)};
|
||||||
global Ast_Type type__f64 = {TYPE_F64, sizeof(F64), __alignof(F64)};
|
global Ast_Type type__f64 = {TYPE_F64, sizeof(F64), __alignof(F64)};
|
||||||
|
|||||||
Reference in New Issue
Block a user