Working on type operations and type infos

This commit is contained in:
Krzosa Karol
2022-06-19 00:05:22 +02:00
parent 9d2ce3560b
commit fc0d4345ee
4 changed files with 37 additions and 22 deletions

View File

@@ -14,7 +14,6 @@ Any :: struct
*/
Type_ID :: S32
Type_Info_Kind :: enum
NONE
S64 :: 7 // FIRST_NUMERIC
@@ -45,29 +44,29 @@ Type_Info_Kind :: enum
Type_Info_Struct_Member :: struct
name: String
type_id: Type_ID
offset: S32
type: Type
offset: S64
Type_Info :: struct
kind: Type_Info_Kind
size: S32
align: S32
size: S64
align: S64
is_unsigned: Bool
type_id: Type_ID
type: Type
base_type: Type_ID
array_size: S32
struct_member_count: S32
base_type: Type
array_size: S64
struct_member_count: S64
struct_members: *Type_Info_Struct_Member
lambda_argument_count: S32
lambda_argument_count: S64
lambda_arguments: *Type_Info
lambda_return: Type_ID
lambda_return: Type
type_infos_len: S32 #foreign
type_infos_len: S64 #foreign
type_infos : *Type_Info #foreign
get_type_info :: (type: Type): *Type_Info
id := type->S32
id := type->S64
if id >= type_infos_len
return 0
return type_infos + id