make meta & eval type system a bit richer to express plain text vs. code text vs. path text

This commit is contained in:
Ryan Fleury
2024-10-01 12:04:40 -07:00
parent 685cb4a3b8
commit 911f9ef97b
5 changed files with 41 additions and 54 deletions
+4 -21
View File
@@ -100,9 +100,10 @@ TypeKind;
typedef U32 TypeFlags;
enum
{
TypeFlag_IsExternal = (1<<0),
TypeFlag_IsCode = (1<<1),
TypeFlag_IsPath = (1<<2),
TypeFlag_IsExternal = (1<<0),
TypeFlag_IsPlainText = (1<<1),
TypeFlag_IsCodeText = (1<<2),
TypeFlag_IsPathText = (1<<3),
};
typedef U32 MemberFlags;
@@ -212,24 +213,6 @@ struct_members(String8)
};
struct_type(String8);
//- rjf: String8 (Code)
ptr_type(String8_Code__str_ptr_type, type(U8), str8_lit_comp("size"), .flags = TypeFlag_IsCode);
struct_members(String8_Code)
{
member_lit_comp(String8, &String8_Code__str_ptr_type, str),
member_lit_comp(String8, type(U64), size),
};
named_struct_type(String8_Code, String8);
//- rjf: String8 (Path)
ptr_type(String8_Path__str_ptr_type, type(U8), str8_lit_comp("size"), .flags = TypeFlag_IsPath);
struct_members(String8_Path)
{
member_lit_comp(String8, &String8_Path__str_ptr_type, str),
member_lit_comp(String8, type(U64), size),
};
named_struct_type(String8_Path, String8);
//- rjf: String8Node
extern Type String8Node__type;
Type String8Node__ptr_type = {TypeKind_Ptr, 0, sizeof(void *), &String8Node__type};