eliminate old manual serialization code for meta evals in ctrl msgs

This commit is contained in:
Ryan Fleury
2024-09-18 17:01:59 -07:00
parent 7c41fc11e0
commit 714c736530
18 changed files with 135 additions and 180 deletions
+7 -7
View File
@@ -517,7 +517,7 @@ mg_child_array_from_node(Arena *arena, MD_Node *node)
{
MG_NodeArray children = mg_node_array_make(arena, md_child_count_from_node(node));
U64 idx = 0;
for(MD_EachNode(child, node->first))
for MD_EachNode(child, node->first)
{
children.v[idx] = child;
idx += 1;
@@ -533,7 +533,7 @@ mg_node_grid_make_from_node(Arena *arena, MD_Node *root)
// rjf: determine dimensions
U64 row_count = md_child_count_from_node(root);
U64 column_count = 0;
for(MD_EachNode(row, root->first))
for MD_EachNode(row, root->first)
{
U64 cell_count_this_row = md_child_count_from_node(row);
column_count = Max(column_count, cell_count_this_row);
@@ -548,11 +548,11 @@ mg_node_grid_make_from_node(Arena *arena, MD_Node *root)
// rjf: fill nodes
{
U64 y = 0;
for(MD_EachNode(row, root->first))
for MD_EachNode(row, root->first)
{
U64 x = 0;
grid.row_parents.v[y] = row;
for(MD_EachNode(cell, row->first))
for MD_EachNode(cell, row->first)
{
grid.cells.v[x*grid.x_stride + y*grid.y_stride] = cell;
x += 1;
@@ -622,7 +622,7 @@ mg_column_desc_array_from_tag(Arena *arena, MD_Node *tag)
result.count = md_child_count_from_node(tag);
result.v = push_array(arena, MG_ColumnDesc, result.count);
U64 idx = 0;
for(MD_EachNode(hdr, tag->first))
for MD_EachNode(hdr, tag->first)
{
result.v[idx].name = push_str8_copy(arena, hdr->string);
result.v[idx].kind = MG_ColumnKind_DirectCell;
@@ -1031,12 +1031,12 @@ mg_string_list_from_table_gen(Arena *arena, MG_Map grid_name_map, MG_Map grid_co
str8_list_push(arena, &result, gen->string);
str8_list_push(arena, &result, str8_lit("\n"));
}
else for(MD_EachNode(strexpr_node, gen->first))
else for MD_EachNode(strexpr_node, gen->first)
{
// rjf: build task list
MG_TableExpandTask *first_task = 0;
MG_TableExpandTask *last_task = 0;
for(MD_EachNode(tag, strexpr_node->first_tag))
for MD_EachNode(tag, strexpr_node->first_tag)
{
if(str8_match(tag->string, str8_lit("expand"), 0))
{
+10 -10
View File
@@ -129,7 +129,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
MD_Node *table_tag = md_tag_from_string(node, str8_lit("table"), 0);
if(!md_node_is_nil(table_tag))
@@ -154,7 +154,7 @@ entry_point(CmdLine *cmdline)
MD_Node *file = n->v.root;
String8 layer_key = mg_layer_key_from_path(file->string);
MG_Layer *layer = mg_layer_from_key(layer_key);
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
if(md_node_has_tag(node, str8_lit("option"), 0))
{
@@ -220,7 +220,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
MD_Node *tag = md_tag_from_string(node, str8_lit("enum"), 0);
if(!md_node_is_nil(tag))
@@ -267,7 +267,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
MD_Node *tag = md_tag_from_string(node, str8_lit("xlist"), 0);
if(!md_node_is_nil(tag))
@@ -292,7 +292,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
if(md_node_has_tag(node, str8_lit("struct"), 0))
{
@@ -317,7 +317,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
MD_Node *tag = md_tag_from_string(node, str8_lit("data"), 0);
if(!md_node_is_nil(tag))
@@ -347,7 +347,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
MD_Node *tag = md_tag_from_string(node, str8_lit("enum2string_switch"), 0);
if(!md_node_is_nil(tag))
@@ -380,7 +380,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
MD_Node *tag = md_tag_from_string(node, str8_lit("gen"), 0);
if(!md_node_is_nil(tag))
@@ -412,7 +412,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
if(md_node_has_tag(node, str8_lit("embed_string"), 0))
{
@@ -446,7 +446,7 @@ entry_point(CmdLine *cmdline)
for(MG_FileParseNode *n = parses.first; n != 0; n = n->next)
{
MD_Node *file = n->v.root;
for(MD_EachNode(node, file->first))
for MD_EachNode(node, file->first)
{
//- rjf: generate markdown page
if(md_node_has_tag(node, str8_lit("markdown"), 0))