eliminate old eval vis view rule paths; sketch out view-rule-lookup & expr-tag-equipping, & expr tag (view rule) inheritance

This commit is contained in:
Ryan Fleury
2025-02-06 12:14:12 -08:00
parent d1541d3989
commit 7bc1dd7362
12 changed files with 152 additions and 220 deletions
@@ -105,22 +105,3 @@ EV_ViewRuleTable:
{x Hex hex "hex" x - - - "Display In Hexadecimal" x "" "Specifies that all numeric values should be shown in base 16 (hexadecimal)." }
{x NoAddress no_addr "no_addr" x - - - "Omit Addresses" x "" "Specifies that addresses should be omitted from visualizations, if possible." }
}
@enum EV_ViewRuleKind:
{
EV_ViewRuleKind_Null,
@expand(EV_ViewRuleTable a) `$(a.name)`,
COUNT,
}
@gen
{
@expand(EV_ViewRuleTable a) `$(a.xe == "x" -> "EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(" .. a.name_lower .. ");")`;
}
@data(EV_ViewRuleInfo) @c_file ev_builtin_view_rule_info_table:
{
`{0}`,
@expand(EV_ViewRuleTable a)
```{str8_lit_comp("$(a.string)"), (EV_ViewRuleInfoFlag_Inherited*$(a.ih == "x"))|(EV_ViewRuleInfoFlag_Expandable*$(a.ex == "x")), $(a.xe == "x" -> "EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME("..a.name_lower..")") }```;
}
@@ -99,7 +99,7 @@ ev_arch_from_eval_params(E_Eval eval, MD_Node *params)
////////////////////////////////
//~ rjf: "list"
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(list)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(list)
{
EV_ExpandInfo info = {0};
return info;
@@ -9,7 +9,7 @@
////////////////////////////////
//~ rjf: Nil/Identity View Rule Hooks
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(nil)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(nil)
{
EV_ExpandInfo info = {0};
return info;
@@ -317,56 +317,50 @@ ev_key_set_view_rule(EV_View *view, EV_Key key, String8 view_rule_string)
//~ rjf: View Rule Info Table Building / Selection / Lookups
internal void
ev_view_rule_info_table_push(Arena *arena, EV_ViewRuleInfoTable *table, EV_ViewRuleInfo *info)
ev_expand_rule_table_push(Arena *arena, EV_ExpandRuleTable *table, EV_ExpandRule *info)
{
if(table->slots_count == 0)
{
table->slots_count = 512;
table->slots = push_array(arena, EV_ViewRuleInfoSlot, table->slots_count);
table->slots = push_array(arena, EV_ExpandRuleSlot, table->slots_count);
}
U64 hash = ev_hash_from_seed_string(5381, info->string);
U64 slot_idx = hash%table->slots_count;
EV_ViewRuleInfoSlot *slot = &table->slots[slot_idx];
EV_ViewRuleInfoNode *n = push_array(arena, EV_ViewRuleInfoNode, 1);
EV_ExpandRuleSlot *slot = &table->slots[slot_idx];
EV_ExpandRuleNode *n = push_array(arena, EV_ExpandRuleNode, 1);
SLLQueuePush(slot->first, slot->last, n);
MemoryCopyStruct(&n->v, info);
n->v.string = push_str8_copy(arena, n->v.string);
}
internal void
ev_view_rule_info_table_push_builtins(Arena *arena, EV_ViewRuleInfoTable *table)
{
for EachNonZeroEnumVal(EV_ViewRuleKind, kind)
{
ev_view_rule_info_table_push(arena, table, &ev_builtin_view_rule_info_table[kind]);
}
}
internal void
ev_select_view_rule_info_table(EV_ViewRuleInfoTable *table)
ev_select_expand_rule_table(EV_ExpandRuleTable *table)
{
ev_view_rule_info_table = table;
}
internal EV_ViewRuleInfo *
ev_view_rule_info_from_string(String8 string)
internal EV_ExpandRule *
ev_expand_rule_from_string(String8 string)
{
EV_ViewRuleInfo *info = &ev_nil_view_rule_info;
U64 hash = ev_hash_from_seed_string(5381, string);
U64 slot_idx = hash%ev_view_rule_info_table->slots_count;
EV_ViewRuleInfoSlot *slot = &ev_view_rule_info_table->slots[slot_idx];
EV_ViewRuleInfoNode *node = 0;
for(EV_ViewRuleInfoNode *n = slot->first; n != 0; n = n->next)
EV_ExpandRule *info = &ev_nil_expand_rule;
if(ev_view_rule_info_table != 0 && ev_view_rule_info_table->slots_count != 0)
{
if(str8_match(n->v.string, string, 0))
U64 hash = ev_hash_from_seed_string(5381, string);
U64 slot_idx = hash%ev_view_rule_info_table->slots_count;
EV_ExpandRuleSlot *slot = &ev_view_rule_info_table->slots[slot_idx];
EV_ExpandRuleNode *node = 0;
for(EV_ExpandRuleNode *n = slot->first; n != 0; n = n->next)
{
node = n;
break;
if(str8_match(n->v.string, string, 0))
{
node = n;
break;
}
}
if(node != 0)
{
info = &node->v;
}
}
if(node != 0)
{
info = &node->v;
}
return info;
}
@@ -446,24 +440,55 @@ ev_resolved_from_expr(Arena *arena, E_Expr *expr)
}
#endif
////////////////////////////////
//~ rjf: Upgrading Expressions w/ Tags From All Sources
internal void
ev_keyed_expr_push_tags(Arena *arena, EV_View *view, EV_Block *block, EV_Key key, E_Expr *expr)
{
Temp scratch = scratch_begin(&arena, 1);
String8 tag_expr = push_str8_copy(arena, ev_view_rule_from_key(view, key));
E_TokenArray tag_expr_tokens = e_token_array_from_text(scratch.arena, tag_expr);
E_Parse tag_expr_parse = e_parse_expr_from_text_tokens(arena, tag_expr, &tag_expr_tokens);
for(E_Expr *tag = tag_expr_parse.expr, *next = &e_expr_nil; tag != &e_expr_nil; tag = next)
{
next = tag->next;
e_expr_push_tag(expr, tag);
}
for(EV_Block *b = block; b != &ev_nil_block; b = b->parent)
{
for(E_Expr *src_tag = b->expr->first_tag; src_tag != &e_expr_nil; src_tag = src_tag->next)
{
e_expr_push_tag(expr, e_expr_copy(arena, src_tag));
}
}
scratch_end(scratch);
}
////////////////////////////////
//~ rjf: Block Building
internal EV_BlockTree
ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 string, E_Expr *expr)
ev_block_tree_from_string(Arena *arena, EV_View *view, String8 filter, String8 string)
{
ProfBeginFunction();
EV_BlockTree tree = {&ev_nil_block};
{
Temp scratch = scratch_begin(&arena, 1);
EV_ViewRuleInfo *default_expand_view_rule_info = ev_view_rule_info_from_string(str8_lit("default"));
//- rjf: produce root expression
EV_Key root_key = ev_key_root();
E_TokenArray root_tokens = e_token_array_from_text(scratch.arena, string);
E_Parse root_parse = e_parse_expr_from_text_tokens(arena, string, &root_tokens);
E_Expr *root_expr = root_parse.expr;
ev_keyed_expr_push_tags(arena, view, &ev_nil_block, root_key, root_expr);
//- rjf: generate root block
tree.root = push_array(arena, EV_Block, 1);
MemoryCopyStruct(tree.root, &ev_nil_block);
tree.root->key = ev_key_root();
tree.root->key = root_key;
tree.root->string = string;
tree.root->expr = expr;
tree.root->expr = root_expr;
tree.root->row_count = 1;
tree.total_row_count += 1;
tree.total_item_count += 1;
@@ -517,16 +542,16 @@ ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 str
// rjf: get expr's expansion rule
EV_ExpandRuleTagPair expand_rule_and_tag = ev_expand_rule_tag_pair_from_expr_irtree(t->expr, &expr_irtree);
EV_ViewRuleInfo *expand_rule = expand_rule_and_tag.rule;
EV_ExpandRule *expand_rule = expand_rule_and_tag.rule;
E_Expr *expand_rule_tag = expand_rule_and_tag.tag;
// rjf: get top-level lookup/expansion info
E_LookupInfo lookup_info = lookup_rule->info(arena, &expr_irtree, filter);
EV_ExpandInfo expand_info = expand_rule->expr_expand_info(arena, view, filter, t->expr, expand_rule_tag);
EV_ExpandInfo expand_info = expand_rule->info(arena, view, filter, t->expr, expand_rule_tag);
// rjf: determine expansion info
U64 expansion_row_count = lookup_info.named_expr_count ? lookup_info.named_expr_count : lookup_info.idxed_expr_count;
if(expand_rule != &ev_nil_view_rule_info)
if(expand_rule != &ev_nil_expand_rule)
{
expansion_row_count = expand_info.row_count;
}
@@ -637,14 +662,7 @@ ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 str
if(child_expr != &e_expr_nil)
{
EV_Key child_key = child_keys[idx];
String8 tag_expr = push_str8_copy(arena, ev_view_rule_from_key(view, child_key));
E_TokenArray tag_expr_tokens = e_token_array_from_text(scratch.arena, tag_expr);
E_Parse tag_expr_parse = e_parse_expr_from_text_tokens(arena, tag_expr, &tag_expr_tokens);
for(E_Expr *expr = tag_expr_parse.expr, *next = &e_expr_nil; expr != &e_expr_nil; expr = next)
{
next = expr->next;
e_expr_push_tag(child_expr, expr);
}
ev_keyed_expr_push_tags(arena, view, expansion_block, child_key, child_expr);
Task *task = push_array(scratch.arena, Task, 1);
SLLQueuePush(first_task, last_task, task);
task->parent_block = expansion_block;
@@ -662,21 +680,6 @@ ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 str
return tree;
}
internal EV_BlockTree
ev_block_tree_from_string(Arena *arena, EV_View *view, String8 filter, String8 string)
{
ProfBeginFunction();
EV_BlockTree tree = {0};
Temp scratch = scratch_begin(&arena, 1);
{
E_Parse parse = e_parse_expr_from_text__cached(string);
tree = ev_block_tree_from_expr(arena, view, filter, string, parse.expr);
}
scratch_end(scratch);
ProfEnd();
return tree;
}
internal U64
ev_depth_from_block(EV_Block *block)
{
@@ -971,6 +974,7 @@ ev_windowed_row_list_from_block_range_list(Arena *arena, EV_View *view, String8
U64 child_id = n->v.block->lookup_rule->id_from_num(child_num, n->v.block->lookup_rule_user_data);
EV_Key row_key = ev_key_make(ev_hash_from_key(n->v.block->key), child_id);
E_Expr *row_expr = range_exprs[idx];
ev_keyed_expr_push_tags(arena, view, n->v.block, row_key, row_expr);
EV_WindowedRowNode *row_node = push_array(arena, EV_WindowedRowNode, 1);
SLLQueuePush(rows.first, rows.last, row_node);
rows.count += 1;
@@ -1059,28 +1063,26 @@ ev_row_is_expandable(EV_Row *row)
{
B32 result = 0;
{
Temp scratch = scratch_begin(0, 0);
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(scratch.arena, row->expr);
// rjf: determine if view rules force expandability
if(!result)
{
for(E_Expr *tag = row->expr->first_tag; tag != &e_expr_nil; tag = tag->next)
EV_ExpandRuleTagPair expand_rule_and_tag = ev_expand_rule_tag_pair_from_expr_irtree(row->expr, &irtree);
if(expand_rule_and_tag.rule != &ev_nil_expand_rule)
{
EV_ViewRuleInfo *info = ev_view_rule_info_from_string(tag->string);
if(info->flags & EV_ViewRuleInfoFlag_Expandable)
{
result = 1;
break;
}
result = 1;
}
}
// rjf: determine if type info force expandability
if(!result)
{
Temp scratch = scratch_begin(0, 0);
E_IRTreeAndType irtree = e_irtree_and_type_from_expr(scratch.arena, row->expr);
result = ev_type_key_and_mode_is_expandable(irtree.type_key, irtree.mode);
scratch_end(scratch);
}
scratch_end(scratch);
}
return result;
}
@@ -1501,16 +1503,15 @@ ev_escaped_from_raw_string(Arena *arena, String8 raw)
internal EV_ExpandRuleTagPair
ev_expand_rule_tag_pair_from_expr_irtree(E_Expr *expr, E_IRTreeAndType *irtree)
{
EV_ViewRuleInfo *default_expand_view_rule = ev_view_rule_info_from_string(str8_lit("default"));
EV_ExpandRuleTagPair result = {default_expand_view_rule, &e_expr_nil};
EV_ExpandRuleTagPair result = {&ev_nil_expand_rule, &e_expr_nil};
{
// rjf: first try explicitly-stored tags
if(result.rule == default_expand_view_rule)
if(result.rule == &ev_nil_expand_rule)
{
for(E_Expr *tag = expr->first_tag; tag != &e_expr_nil; tag = tag->next)
{
EV_ViewRuleInfo *candidate = ev_view_rule_info_from_string(tag->string);
if(candidate != &ev_nil_view_rule_info)
EV_ExpandRule *candidate = ev_expand_rule_from_string(tag->string);
if(candidate != &ev_nil_expand_rule)
{
result.rule = candidate;
result.tag = tag;
@@ -1520,15 +1521,15 @@ ev_expand_rule_tag_pair_from_expr_irtree(E_Expr *expr, E_IRTreeAndType *irtree)
}
// rjf: next try implicit set name -> rule mapping
if(result.rule == default_expand_view_rule)
if(result.rule == &ev_nil_expand_rule)
{
E_TypeKind type_kind = e_type_kind_from_key(irtree->type_key);
if(type_kind == E_TypeKind_Set)
{
E_Type *type = e_type_from_key__cached(irtree->type_key);
String8 name = type->name;
EV_ViewRuleInfo *candidate = ev_view_rule_info_from_string(name);
if(candidate != &ev_nil_view_rule_info)
EV_ExpandRule *candidate = ev_expand_rule_from_string(name);
if(candidate != &ev_nil_expand_rule)
{
result.rule = candidate;
}
@@ -1536,13 +1537,13 @@ ev_expand_rule_tag_pair_from_expr_irtree(E_Expr *expr, E_IRTreeAndType *irtree)
}
// rjf: next try auto hook map
if(result.rule == default_expand_view_rule)
if(result.rule == &ev_nil_expand_rule)
{
E_ExprList tags = e_auto_hook_tag_exprs_from_type_key__cached(irtree->type_key);
for(E_ExprNode *n = tags.first; n != 0; n = n->next)
{
EV_ViewRuleInfo *candidate = ev_view_rule_info_from_string(n->v->string);
if(candidate != &ev_nil_view_rule_info)
EV_ExpandRule *candidate = ev_expand_rule_from_string(n->v->string);
if(candidate != &ev_nil_expand_rule)
{
result.rule = candidate;
result.tag = n->v;
@@ -87,44 +87,36 @@ struct EV_ExpandInfo
B32 rows_default_expanded;
};
#define EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_SIG(name) EV_ExpandInfo name(Arena *arena, EV_View *view, String8 filter, E_Expr *expr, E_Expr *tag)
#define EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(name) ev_view_rule_expr_expand_info__##name
#define EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(name) internal EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_SIG(EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(name))
typedef EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_SIG(EV_ViewRuleExprExpandInfoHookFunctionType);
#define EV_EXPAND_RULE_INFO_FUNCTION_SIG(name) EV_ExpandInfo name(Arena *arena, EV_View *view, String8 filter, E_Expr *expr, E_Expr *tag)
#define EV_EXPAND_RULE_INFO_FUNCTION_NAME(name) ev_expand_rule_info__##name
#define EV_EXPAND_RULE_INFO_FUNCTION_DEF(name) internal EV_EXPAND_RULE_INFO_FUNCTION_SIG(EV_EXPAND_RULE_INFO_FUNCTION_NAME(name))
typedef EV_EXPAND_RULE_INFO_FUNCTION_SIG(EV_ExpandRuleInfoHookFunctionType);
typedef U32 EV_ViewRuleInfoFlags; // NOTE(rjf): see @view_rule_info
enum
{
EV_ViewRuleInfoFlag_Inherited = (1<<0),
EV_ViewRuleInfoFlag_Expandable = (1<<1),
};
typedef struct EV_ViewRuleInfo EV_ViewRuleInfo;
struct EV_ViewRuleInfo
typedef struct EV_ExpandRule EV_ExpandRule;
struct EV_ExpandRule
{
String8 string;
EV_ViewRuleInfoFlags flags;
EV_ViewRuleExprExpandInfoHookFunctionType *expr_expand_info;
EV_ExpandRuleInfoHookFunctionType *info;
};
typedef struct EV_ViewRuleInfoNode EV_ViewRuleInfoNode;
struct EV_ViewRuleInfoNode
typedef struct EV_ExpandRuleNode EV_ExpandRuleNode;
struct EV_ExpandRuleNode
{
EV_ViewRuleInfoNode *next;
EV_ViewRuleInfo v;
EV_ExpandRuleNode *next;
EV_ExpandRule v;
};
typedef struct EV_ViewRuleInfoSlot EV_ViewRuleInfoSlot;
struct EV_ViewRuleInfoSlot
typedef struct EV_ExpandRuleSlot EV_ExpandRuleSlot;
struct EV_ExpandRuleSlot
{
EV_ViewRuleInfoNode *first;
EV_ViewRuleInfoNode *last;
EV_ExpandRuleNode *first;
EV_ExpandRuleNode *last;
};
typedef struct EV_ViewRuleInfoTable EV_ViewRuleInfoTable;
struct EV_ViewRuleInfoTable
typedef struct EV_ExpandRuleTable EV_ExpandRuleTable;
struct EV_ExpandRuleTable
{
EV_ViewRuleInfoSlot *slots;
EV_ExpandRuleSlot *slots;
U64 slots_count;
};
@@ -134,7 +126,7 @@ struct EV_ViewRuleInfoTable
typedef struct EV_ExpandRuleTagPair EV_ExpandRuleTagPair;
struct EV_ExpandRuleTagPair
{
EV_ViewRuleInfo *rule;
EV_ExpandRule *rule;
E_Expr *tag;
};
@@ -163,7 +155,7 @@ struct EV_Block
E_Expr *lookup_tag;
E_Expr *expand_tag;
E_LookupRule *lookup_rule;
EV_ViewRuleInfo *expand_rule;
EV_ExpandRule *expand_rule;
void *lookup_rule_user_data;
void *expand_rule_user_data;
@@ -280,20 +272,19 @@ enum
////////////////////////////////
//~ rjf: Nil/Identity View Rule Hooks
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(nil);
EV_EXPAND_RULE_INFO_FUNCTION_DEF(nil);
////////////////////////////////
//~ rjf: Globals
global read_only EV_ViewRuleInfo ev_nil_view_rule_info =
global read_only EV_ExpandRule ev_nil_expand_rule =
{
{0},
0,
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil),
EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil),
};
thread_static EV_ViewRuleInfoTable *ev_view_rule_info_table = 0;
thread_static EV_ExpandRuleTable *ev_view_rule_info_table = 0;
thread_static EV_AutoViewRuleTable *ev_auto_view_rule_table = 0;
global read_only EV_Block ev_nil_block = {&ev_nil_block, &ev_nil_block, &ev_nil_block, &ev_nil_block, &ev_nil_block, {0}, 0, {0}, &e_expr_nil, &e_expr_nil, &e_expr_nil, &e_lookup_rule__nil, &ev_nil_view_rule_info};
global read_only EV_Block ev_nil_block = {&ev_nil_block, &ev_nil_block, &ev_nil_block, &ev_nil_block, &ev_nil_block, {0}, 0, {0}, &e_expr_nil, &e_expr_nil, &e_expr_nil, &e_lookup_rule__nil, &ev_nil_expand_rule};
////////////////////////////////
//~ rjf: Key Functions
@@ -329,10 +320,9 @@ internal void ev_key_set_view_rule(EV_View *view, EV_Key key, String8 view_rule_
////////////////////////////////
//~ rjf: View Rule Info Table Building / Selection / Lookups
internal void ev_view_rule_info_table_push(Arena *arena, EV_ViewRuleInfoTable *table, EV_ViewRuleInfo *info);
internal void ev_view_rule_info_table_push_builtins(Arena *arena, EV_ViewRuleInfoTable *table);
internal void ev_select_view_rule_info_table(EV_ViewRuleInfoTable *table);
internal EV_ViewRuleInfo *ev_view_rule_info_from_string(String8 string);
internal void ev_expand_rule_table_push(Arena *arena, EV_ExpandRuleTable *table, EV_ExpandRule *info);
internal void ev_select_expand_rule_table(EV_ExpandRuleTable *table);
internal EV_ExpandRule *ev_expand_rule_from_string(String8 string);
////////////////////////////////
//~ rjf: Expression Resolution (Dynamic Overrides, View Rule Application)
@@ -341,10 +331,14 @@ internal EV_ViewRuleInfo *ev_view_rule_info_from_string(String8 string);
internal E_Expr *ev_resolved_from_expr(Arena *arena, E_Expr *expr);
#endif
////////////////////////////////
//~ rjf: Upgrading Expressions w/ Tags From All Sources
internal void ev_keyed_expr_push_tags(Arena *arena, EV_View *view, EV_Block *block, EV_Key key, E_Expr *expr);
////////////////////////////////
//~ rjf: Block Building
internal EV_BlockTree ev_block_tree_from_expr(Arena *arena, EV_View *view, String8 filter, String8 string, E_Expr *expr);
internal EV_BlockTree ev_block_tree_from_string(Arena *arena, EV_View *view, String8 filter, String8 string);
internal U64 ev_depth_from_block(EV_Block *block);
@@ -3,24 +3,3 @@
//- GENERATED CODE
C_LINKAGE_BEGIN
EV_ViewRuleInfo ev_builtin_view_rule_info_table[14] =
{
{0},
{str8_lit_comp("array"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("list"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(list) },
{str8_lit_comp("slice"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("bswap"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("cast"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("wrap"), (EV_ViewRuleInfoFlag_Inherited*0)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("only"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("omit"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("bin"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("oct"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("dec"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("hex"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), },
{str8_lit_comp("no_addr"), (EV_ViewRuleInfoFlag_Inherited*1)|(EV_ViewRuleInfoFlag_Expandable*0), },
};
C_LINKAGE_END
@@ -6,24 +6,4 @@
#ifndef EVAL_VISUALIZATION_META_H
#define EVAL_VISUALIZATION_META_H
typedef enum EV_ViewRuleKind
{
EV_ViewRuleKind_EV_ViewRuleKind_Null,
EV_ViewRuleKind_Array,
EV_ViewRuleKind_List,
EV_ViewRuleKind_Slice,
EV_ViewRuleKind_ByteSwap,
EV_ViewRuleKind_Cast,
EV_ViewRuleKind_Wrap,
EV_ViewRuleKind_Only,
EV_ViewRuleKind_Omit,
EV_ViewRuleKind_Bin,
EV_ViewRuleKind_Oct,
EV_ViewRuleKind_Dec,
EV_ViewRuleKind_Hex,
EV_ViewRuleKind_NoAddress,
EV_ViewRuleKind_COUNT,
} EV_ViewRuleKind;
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(list);
#endif // EVAL_VISUALIZATION_META_H
+13 -13
View File
@@ -719,19 +719,19 @@ str8_lit_comp("c"),
RD_ViewRuleInfo rd_view_rule_kind_info_table[13] =
{
{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(null)},
{str8_lit_comp("empty"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(empty)},
{str8_lit_comp("getting_started"), str8_lit_comp(""), str8_lit_comp("Getting Started"), str8_lit_comp(""), RD_IconKind_QuestionMark, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(getting_started)},
{str8_lit_comp("settings"), str8_lit_comp("An interface to modify general settings for the debugger's appearance and behavior."), str8_lit_comp("Settings"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(settings)},
{str8_lit_comp("pending_file"), str8_lit_comp(""), str8_lit_comp("Pending File"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(pending_file)},
{str8_lit_comp("watch"), str8_lit_comp("The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section."), str8_lit_comp("Watch"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(watch)},
{str8_lit_comp("text"), str8_lit_comp(""), str8_lit_comp("Text"), str8_lit_comp("x:{'lang':lang, 'size':expr}"), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(text) , RD_VIEW_RULE_UI_FUNCTION_NAME(text)},
{str8_lit_comp("disasm"), str8_lit_comp("Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space."), str8_lit_comp("Disassembly"), str8_lit_comp("x:{'arch':arch, 'size':expr, 'addresses':bool, 'code_bytes':bool}"), RD_IconKind_Glasses, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(disasm) , RD_VIEW_RULE_UI_FUNCTION_NAME(disasm)},
{str8_lit_comp("memory"), str8_lit_comp("A hex-editor-like grid interface for viewing memory."), str8_lit_comp("Memory"), str8_lit_comp("x:{'size':expr}"), RD_IconKind_Grid, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(memory) , RD_VIEW_RULE_UI_FUNCTION_NAME(memory)},
{str8_lit_comp("bitmap"), str8_lit_comp("Visualizes memory as a bitmap."), str8_lit_comp("Bitmap"), str8_lit_comp("x:{'w':expr, 'h':expr, 'fmt':tex2dformat}"), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(bitmap) , RD_VIEW_RULE_UI_FUNCTION_NAME(bitmap)},
{str8_lit_comp("checkbox"), str8_lit_comp("Visualizes memory as an RGBA color."), str8_lit_comp("Checkbox"), str8_lit_comp(""), RD_IconKind_CheckFilled, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*1|RD_ViewRuleInfoFlag_CanExpand*0), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(checkbox)},
{str8_lit_comp("color_rgba"), str8_lit_comp("Visualizes memory as an RGBA color."), str8_lit_comp("Color (RGBA)"), str8_lit_comp(""), RD_IconKind_Palette, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*1|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(color_rgba) , RD_VIEW_RULE_UI_FUNCTION_NAME(color_rgba)},
{str8_lit_comp("geo3d"), str8_lit_comp("Visualizes memory as 3D geometry."), str8_lit_comp("Geometry (3D)"), str8_lit_comp("x:{'count':expr, 'vtx':expr, 'vtx_size':expr}"), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(geo3d) , RD_VIEW_RULE_UI_FUNCTION_NAME(geo3d)},
{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(null)},
{str8_lit_comp("empty"), str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp(""), RD_IconKind_Null, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(empty)},
{str8_lit_comp("getting_started"), str8_lit_comp(""), str8_lit_comp("Getting Started"), str8_lit_comp(""), RD_IconKind_QuestionMark, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(getting_started)},
{str8_lit_comp("settings"), str8_lit_comp("An interface to modify general settings for the debugger's appearance and behavior."), str8_lit_comp("Settings"), str8_lit_comp(""), RD_IconKind_Gear, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(settings)},
{str8_lit_comp("pending_file"), str8_lit_comp(""), str8_lit_comp("Pending File"), str8_lit_comp(""), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(pending_file)},
{str8_lit_comp("watch"), str8_lit_comp("The familiar 'watch window' debugger interface. Allows the inputting of a number of expressions. Each expression in the table is evaluated within the context of the selected thread's selected call stack frame. If applicable (depending on visualization rules and the expression's type), these expressions may be hierarchically expanded, which displays children as more rows in the table. The values of these expressions may also be edited, and if possible, can be used to write to registers or memory in attached processes. Also contains a new *view rule* column, not found in other major debuggers, which allows per-row specification of various visualization rules. These view rules may be used to visualize and inspect the evaluation of expressions in a variety of ways. To learn more, read the 'View Rules' section."), str8_lit_comp("Watch"), str8_lit_comp(""), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*1|RD_ViewRuleInfoFlag_FilterIsCode*1|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*1|RD_ViewRuleInfoFlag_CanUseInWatchTable*0|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*0), EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(watch)},
{str8_lit_comp("text"), str8_lit_comp(""), str8_lit_comp("Text"), str8_lit_comp("x:{'lang':lang, 'size':expr}"), RD_IconKind_FileOutline, (RD_ViewRuleInfoFlag_ShowInDocs*0|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_EXPAND_RULE_INFO_FUNCTION_NAME(text) , RD_VIEW_RULE_UI_FUNCTION_NAME(text)},
{str8_lit_comp("disasm"), str8_lit_comp("Displays disassembled instructions in a textual form from the selected thread's containing process virtual address space."), str8_lit_comp("Disassembly"), str8_lit_comp("x:{'arch':arch, 'size':expr, 'addresses':bool, 'code_bytes':bool}"), RD_IconKind_Glasses, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_EXPAND_RULE_INFO_FUNCTION_NAME(disasm) , RD_VIEW_RULE_UI_FUNCTION_NAME(disasm)},
{str8_lit_comp("memory"), str8_lit_comp("A hex-editor-like grid interface for viewing memory."), str8_lit_comp("Memory"), str8_lit_comp("x:{'size':expr}"), RD_IconKind_Grid, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_EXPAND_RULE_INFO_FUNCTION_NAME(memory) , RD_VIEW_RULE_UI_FUNCTION_NAME(memory)},
{str8_lit_comp("bitmap"), str8_lit_comp("Visualizes memory as a bitmap."), str8_lit_comp("Bitmap"), str8_lit_comp("x:{'w':expr, 'h':expr, 'fmt':tex2dformat}"), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_EXPAND_RULE_INFO_FUNCTION_NAME(bitmap) , RD_VIEW_RULE_UI_FUNCTION_NAME(bitmap)},
{str8_lit_comp("checkbox"), str8_lit_comp("Visualizes memory as an RGBA color."), str8_lit_comp("Checkbox"), str8_lit_comp(""), RD_IconKind_CheckFilled, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*1|RD_ViewRuleInfoFlag_CanExpand*0), EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(checkbox)},
{str8_lit_comp("color_rgba"), str8_lit_comp("Visualizes memory as an RGBA color."), str8_lit_comp("Color (RGBA)"), str8_lit_comp(""), RD_IconKind_Palette, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*1|RD_ViewRuleInfoFlag_CanExpand*1), EV_EXPAND_RULE_INFO_FUNCTION_NAME(color_rgba) , RD_VIEW_RULE_UI_FUNCTION_NAME(color_rgba)},
{str8_lit_comp("geo3d"), str8_lit_comp("Visualizes memory as 3D geometry."), str8_lit_comp("Geometry (3D)"), str8_lit_comp("x:{'count':expr, 'vtx':expr, 'vtx_size':expr}"), RD_IconKind_Binoculars, (RD_ViewRuleInfoFlag_ShowInDocs*1|RD_ViewRuleInfoFlag_CanFilter*0|RD_ViewRuleInfoFlag_FilterIsCode*0|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*0|RD_ViewRuleInfoFlag_CanUseInWatchTable*1|RD_ViewRuleInfoFlag_CanFillValueCell*0|RD_ViewRuleInfoFlag_CanExpand*1), EV_EXPAND_RULE_INFO_FUNCTION_NAME(geo3d) , RD_VIEW_RULE_UI_FUNCTION_NAME(geo3d)},
};
RD_IconKind rd_entity_kind_icon_kind_table[27] =
+7 -7
View File
@@ -587,7 +587,7 @@ String8 display_name;
String8 params_schema;
RD_IconKind icon_kind;
RD_ViewRuleInfoFlags flags;
EV_ViewRuleExprExpandInfoHookFunctionType *expr_expand_info;
EV_ExpandRuleInfoHookFunctionType *expr_expand_info;
RD_ViewRuleUIFunctionType *ui;
};
@@ -631,12 +631,12 @@ RD_ViewRuleUIFunctionType *ui;
.os_event = rd_regs()->os_event,\
RD_VIEW_RULE_UI_FUNCTION_DEF(null);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(text);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(disasm);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(memory);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(bitmap);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(color_rgba);
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(geo3d);
EV_EXPAND_RULE_INFO_FUNCTION_DEF(text);
EV_EXPAND_RULE_INFO_FUNCTION_DEF(disasm);
EV_EXPAND_RULE_INFO_FUNCTION_DEF(memory);
EV_EXPAND_RULE_INFO_FUNCTION_DEF(bitmap);
EV_EXPAND_RULE_INFO_FUNCTION_DEF(color_rgba);
EV_EXPAND_RULE_INFO_FUNCTION_DEF(geo3d);
RD_VIEW_RULE_UI_FUNCTION_DEF(empty);
RD_VIEW_RULE_UI_FUNCTION_DEF(getting_started);
RD_VIEW_RULE_UI_FUNCTION_DEF(settings);
+4 -4
View File
@@ -1057,21 +1057,21 @@ RD_ViewRuleTable:
`String8 params_schema`;
`RD_IconKind icon_kind`;
`RD_ViewRuleInfoFlags flags`;
`EV_ViewRuleExprExpandInfoHookFunctionType *expr_expand_info`;
`EV_ExpandRuleInfoHookFunctionType *expr_expand_info`;
`RD_ViewRuleUIFunctionType *ui`;
}
@gen
{
`RD_VIEW_RULE_UI_FUNCTION_DEF(null);`,
@expand(RD_ViewRuleTable a) `$(a.can_use_in_watch_table != 0 && a.can_expand != 0 -> "EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(" .. a.name_lower .. ");")`,
@expand(RD_ViewRuleTable a) `$(a.can_use_in_watch_table != 0 && a.can_expand != 0 -> "EV_EXPAND_RULE_INFO_FUNCTION_DEF(" .. a.name_lower .. ");")`,
@expand(RD_ViewRuleTable a) `RD_VIEW_RULE_UI_FUNCTION_DEF($(a.name_lower));`,
}
@data(RD_ViewRuleInfo) rd_view_rule_kind_info_table:
{
`{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(null)}`,
@expand(RD_ViewRuleTable a) `{str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.description)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.params_schema)"), RD_IconKind_$(a.icon), (RD_ViewRuleInfoFlag_ShowInDocs*$(a.show_in_docs)|RD_ViewRuleInfoFlag_CanFilter*$(a.can_filter)|RD_ViewRuleInfoFlag_FilterIsCode*$(a.filter_is_code)|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*$(a.typing_automatically_filters)|RD_ViewRuleInfoFlag_CanUseInWatchTable*$(a.can_use_in_watch_table)|RD_ViewRuleInfoFlag_CanFillValueCell*$(a.can_fill_value_cell)|RD_ViewRuleInfoFlag_CanExpand*$(a.can_expand)), $(a.can_expand != 0 -> "EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(" .. a.name_lower .. ")") $(a.can_expand == 0 -> "EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil)"), RD_VIEW_RULE_UI_FUNCTION_NAME($(a.name_lower))}`,
`{{0}, {0}, {0}, {0}, RD_IconKind_Null, 0, EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil), RD_VIEW_RULE_UI_FUNCTION_NAME(null)}`,
@expand(RD_ViewRuleTable a) `{str8_lit_comp("$(a.name_lower)"), str8_lit_comp("$(a.description)"), str8_lit_comp("$(a.display_name)"), str8_lit_comp("$(a.params_schema)"), RD_IconKind_$(a.icon), (RD_ViewRuleInfoFlag_ShowInDocs*$(a.show_in_docs)|RD_ViewRuleInfoFlag_CanFilter*$(a.can_filter)|RD_ViewRuleInfoFlag_FilterIsCode*$(a.filter_is_code)|RD_ViewRuleInfoFlag_TypingAutomaticallyFilters*$(a.typing_automatically_filters)|RD_ViewRuleInfoFlag_CanUseInWatchTable*$(a.can_use_in_watch_table)|RD_ViewRuleInfoFlag_CanFillValueCell*$(a.can_fill_value_cell)|RD_ViewRuleInfoFlag_CanExpand*$(a.can_expand)), $(a.can_expand != 0 -> "EV_EXPAND_RULE_INFO_FUNCTION_NAME(" .. a.name_lower .. ")") $(a.can_expand == 0 -> "EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil)"), RD_VIEW_RULE_UI_FUNCTION_NAME($(a.name_lower))}`,
}
////////////////////////////////
+5 -8
View File
@@ -8008,7 +8008,7 @@ struct RD_EntityExpandAccel
//- rjf: control entity hierarchies
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(scheduler_machine)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(scheduler_machine)
{
EV_ExpandInfo info = {0};
Temp scratch = scratch_begin(&arena, 1);
@@ -8072,7 +8072,7 @@ EV_VIEW_RULE_EXPR_EXPAND_NUM_FROM_ID_FUNCTION_DEF(scheduler_machine)
return id;
}
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(scheduler_process)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(scheduler_process)
{
EV_ExpandInfo info = {0};
Temp scratch = scratch_begin(&arena, 1);
@@ -12572,13 +12572,10 @@ rd_frame(void)
e_select_interpret_ctx(interpret_ctx);
////////////////////////////
//- rjf: build eval visualization view rule table
//- rjf: build eval visualization expand rule table
//
EV_ViewRuleInfoTable *view_rule_info_table = push_array(scratch.arena, EV_ViewRuleInfoTable, 1);
{
ev_view_rule_info_table_push_builtins(scratch.arena, view_rule_info_table);
}
ev_select_view_rule_info_table(view_rule_info_table);
EV_ExpandRuleTable *expand_rule_table = push_array(scratch.arena, EV_ExpandRuleTable, 1);
ev_select_expand_rule_table(expand_rule_table);
////////////////////////////
//- rjf: build eval visualization auto-view-rule table
+1 -1
View File
@@ -892,7 +892,7 @@ read_only global RD_ViewRuleInfo rd_nil_view_rule_info =
{0},
RD_IconKind_Null,
0,
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_NAME(nil),
EV_EXPAND_RULE_INFO_FUNCTION_NAME(nil),
RD_VIEW_RULE_UI_FUNCTION_NAME(null)
};
+7 -7
View File
@@ -4303,7 +4303,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(pending_file)
////////////////////////////////
//~ rjf: text @view_hook_impl
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(text)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(text)
{
EV_ExpandInfo info = {0};
info.row_count = 8;
@@ -4558,7 +4558,7 @@ struct RD_DisasmViewState
RD_CodeViewState cv;
};
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(disasm)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(disasm)
{
EV_ExpandInfo info = {0};
info.row_count = 8;
@@ -4783,7 +4783,7 @@ struct RD_MemoryViewState
B32 contain_cursor;
};
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(memory)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(memory)
{
EV_ExpandInfo info = {0};
info.row_count = 16;
@@ -5618,7 +5618,7 @@ RD_VIEW_RULE_UI_FUNCTION_DEF(memory)
////////////////////////////////
//~ rjf: "graph"
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(graph)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(graph)
{
EV_ExpandInfo info = {0};
info.row_count = 8;
@@ -5710,7 +5710,7 @@ internal UI_BOX_CUSTOM_DRAW(rd_bitmap_view_canvas_box_draw)
}
}
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(bitmap)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(bitmap)
{
EV_ExpandInfo info = {0};
info.row_count = 8;
@@ -5958,7 +5958,7 @@ rd_rgba_from_eval_params(E_Eval eval, MD_Node *params)
return rgba;
}
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(color_rgba)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(color_rgba)
{
EV_ExpandInfo info = {0};
info.row_count = 8;
@@ -6119,7 +6119,7 @@ internal UI_BOX_CUSTOM_DRAW(rd_geo3d_box_draw)
dr_mesh(draw_data->vertex_buffer, draw_data->index_buffer, R_GeoTopologyKind_Triangles, R_GeoVertexFlag_TexCoord|R_GeoVertexFlag_Normals|R_GeoVertexFlag_RGB, r_handle_zero(), mat_4x4f32(1.f));
}
EV_VIEW_RULE_EXPR_EXPAND_INFO_FUNCTION_DEF(geo3d)
EV_EXPAND_RULE_INFO_FUNCTION_DEF(geo3d)
{
EV_ExpandInfo info = {0};
info.row_count = 16;