sketch out schemas for configuration trees

This commit is contained in:
Ryan Fleury
2025-01-22 09:40:57 -08:00
parent 16a717d684
commit 7443f33069
3 changed files with 46 additions and 2 deletions
+12 -1
View File
@@ -36,7 +36,7 @@ RD_CmdKind_Null,
RD_CmdKind_Null,
};
RD_VocabularyInfo rd_vocabulary_info_table[39] =
RD_VocabularyInfo rd_vocabulary_info_table[41] =
{
{str8_lit_comp("auto_view_rule"), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rule"), str8_lit_comp("Auto View Rules"), RD_IconKind_Binoculars},
{str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline},
@@ -67,6 +67,7 @@ RD_VocabularyInfo rd_vocabulary_info_table[39] =
{str8_lit_comp("lang"), str8_lit_comp("langs"), str8_lit_comp("Language"), str8_lit_comp("Languages"), RD_IconKind_Null},
{str8_lit_comp("arch"), str8_lit_comp("archs"), str8_lit_comp("Architecture"), str8_lit_comp("Architectures"), RD_IconKind_Null},
{str8_lit_comp("expr"), str8_lit_comp("exprs"), str8_lit_comp("Expression"), str8_lit_comp("Expressions"), RD_IconKind_Null},
{str8_lit_comp("expression"), str8_lit_comp("expressions"), str8_lit_comp("Expression"), str8_lit_comp("Expressions"), RD_IconKind_Null},
{str8_lit_comp("size"), str8_lit_comp("sizes"), str8_lit_comp("Size"), str8_lit_comp("Sizes"), RD_IconKind_Null},
{str8_lit_comp("count"), str8_lit_comp("counts"), str8_lit_comp("Count"), str8_lit_comp("Counts"), RD_IconKind_Null},
{str8_lit_comp("bool"), str8_lit_comp("bools"), str8_lit_comp("Boolean"), str8_lit_comp("Booleans"), RD_IconKind_Null},
@@ -77,6 +78,16 @@ RD_VocabularyInfo rd_vocabulary_info_table[39] =
{str8_lit_comp("code_bytes"), str8_lit_comp("code_bytes"), str8_lit_comp("Code Bytes"), str8_lit_comp("Code Bytes"), RD_IconKind_Null},
{str8_lit_comp("vtx"), str8_lit_comp("vtxs"), str8_lit_comp("Vertex Buffer"), str8_lit_comp("Vertex Buffers"), RD_IconKind_Null},
{str8_lit_comp("vtx_size"), str8_lit_comp("vtx_sizes"), str8_lit_comp("Vertex Buffer Size"), str8_lit_comp("Vertex Buffer Sizes"), RD_IconKind_Null},
{str8_lit_comp("label"), str8_lit_comp("labels"), str8_lit_comp("Label"), str8_lit_comp("Labels"), RD_IconKind_Null},
};
RD_CfgNameSchemaPair rd_cfg_name_schema_pair_table[5] =
{
{str8_lit_comp("target"), str8_lit_comp("x:{'label':code_string, 'exe':path, 'args':string, 'working_directory':path, 'entry_point':code_string, 'stdout_path':path, 'stderr_path':path, 'stdin_path':path, 'debug_subprocesses':bool}")},
{str8_lit_comp("breakpoint"), str8_lit_comp("x:{'label':code_string, 'condition':code_string, 'location':location, 'hit_count':u64, 'enabled':bool}")},
{str8_lit_comp("watch_pin"), str8_lit_comp("x:{'expression':code_string, 'view_rule':code_string, 'location':location}")},
{str8_lit_comp("file_path_map"), str8_lit_comp("x:{'source':path, 'dest':path}")},
{str8_lit_comp("auto_view_rule"), str8_lit_comp("x:{'source':code_string, 'dest':code_string}")},
};
String8 d_entity_kind_display_string_table[27] =
+9 -1
View File
@@ -550,6 +550,13 @@ String8 display_name_plural;
RD_IconKind icon_kind;
};
typedef struct RD_CfgNameSchemaPair RD_CfgNameSchemaPair;
struct RD_CfgNameSchemaPair
{
String8 name;
String8 schema;
};
typedef struct RD_Regs RD_Regs;
struct RD_Regs
{
@@ -779,7 +786,8 @@ extern String8 rd_cfg_src_string_table[4];
extern RD_CmdKind rd_cfg_src_load_cmd_kind_table[4];
extern RD_CmdKind rd_cfg_src_write_cmd_kind_table[4];
extern RD_CmdKind rd_cfg_src_apply_cmd_kind_table[4];
extern RD_VocabularyInfo rd_vocabulary_info_table[39];
extern RD_VocabularyInfo rd_vocabulary_info_table[41];
extern RD_CfgNameSchemaPair rd_cfg_name_schema_pair_table[5];
extern String8 d_entity_kind_display_string_table[27];
extern String8 d_entity_kind_name_lower_table[27];
extern String8 d_entity_kind_name_lower_plural_table[27];
+25
View File
@@ -85,6 +85,7 @@ RD_VocabularyMap:
{lang _ "Language" _ Null }
{arch _ "Architecture" _ Null }
{expr _ "Expression" _ Null }
{expression _ "Expression" _ Null }
{size _ "Size" _ Null }
{count _ "Count" _ Null }
{bool _ "Boolean" _ Null }
@@ -95,6 +96,7 @@ RD_VocabularyMap:
{code_bytes code_bytes "Code Bytes" "Code Bytes" Null }
{vtx _ "Vertex Buffer" _ Null }
{vtx_size _ "Vertex Buffer Size" _ Null }
{label _ "Label" _ Null }
}
@struct RD_VocabularyInfo:
@@ -111,6 +113,29 @@ RD_VocabularyMap:
@expand(RD_VocabularyMap a) `{str8_lit_comp("$(a.code_name)"), str8_lit_comp("$(a.code_name_plural == _ -> a.code_name .. 's')$(a.code_name_plural != _ -> a.code_name_plural)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.display_name_plural == _ -> a.display_name .. 's')$(a.display_name_plural != _ -> a.display_name_plural)"), RD_IconKind_$(a.icon_kind)}`;
}
////////////////////////////////
//~ rjf: Configuration Tree Schemas
@table(name schema) RD_CfgSchemaTable:
{
{target "x:{'label':code_string, 'exe':path, 'args':string, 'working_directory':path, 'entry_point':code_string, 'stdout_path':path, 'stderr_path':path, 'stdin_path':path, 'debug_subprocesses':bool}"}
{breakpoint "x:{'label':code_string, 'condition':code_string, 'location':location, 'hit_count':u64, 'enabled':bool}"}
{watch_pin "x:{'expression':code_string, 'view_rule':code_string, 'location':location}"}
{file_path_map "x:{'source':path, 'dest':path}"}
{auto_view_rule "x:{'source':code_string, 'dest':code_string}"}
}
@struct RD_CfgNameSchemaPair:
{
`String8 name`;
`String8 schema`;
}
@data(RD_CfgNameSchemaPair) rd_cfg_name_schema_pair_table:
{
@expand(RD_CfgSchemaTable a) `{str8_lit_comp("$(a.name)"), str8_lit_comp("$(a.schema)")}`
}
////////////////////////////////
//~ rjf: Entity Kind Tables