mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-23 20:24:59 -07:00
extend eval viz pipeline with split between edit/display expression strings per-block and per-row. this allows reconstruction of the string that would lead to the same eval as a row (even if it is auto-generated by e.g. expanding a root-level row; also allow -- to extend eval expressions with passthrough text, used for view rules
This commit is contained in:
+19
-5
@@ -5025,6 +5025,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
//
|
||||
TG_Key eval_type_key = tg_unwrapped_from_graph_rdi_key(parse_ctx->type_graph, parse_ctx->rdi, eval.type_key);
|
||||
TG_Kind eval_type_kind = tg_kind_from_key(eval_type_key);
|
||||
String8 eval_string = push_str8_copy(arena, string);
|
||||
|
||||
//////////////////////////////
|
||||
//- rjf: make and push block for root
|
||||
@@ -5033,7 +5034,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *block = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Root, parent_key, key, depth);
|
||||
block->eval = eval;
|
||||
block->cfg_table = *cfg_table;
|
||||
block->string = push_str8_copy(arena, string);
|
||||
block->string = eval_string;
|
||||
block->visual_idx_range = r1u64(key.child_num-1, key.child_num+0);
|
||||
block->semantic_idx_range = r1u64(key.child_num-1, key.child_num+0);
|
||||
if(opt_member != 0)
|
||||
@@ -5156,7 +5157,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
expand_view_rule_cfg != &df_g_nil_cfg_val)
|
||||
ProfScope("build viz blocks for lens")
|
||||
{
|
||||
expand_view_rule_spec->info.viz_block_prod(arena, scope, ctrl_ctx, parse_ctx, macro_map, eval_view, eval, cfg_table, parent_key, key, depth+1, expand_view_rule_cfg->last, list_out);
|
||||
expand_view_rule_spec->info.viz_block_prod(arena, scope, ctrl_ctx, parse_ctx, macro_map, eval_view, eval, string, cfg_table, parent_key, key, depth+1, expand_view_rule_cfg->last, list_out);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
@@ -5176,6 +5177,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Members, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
{
|
||||
last_vb->eval = udt_eval;
|
||||
last_vb->string = eval_string;
|
||||
last_vb->cfg_table = *cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, filtered_data_members.count);
|
||||
}
|
||||
@@ -5231,6 +5233,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_EnumMembers, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
{
|
||||
last_vb->eval = udt_eval;
|
||||
last_vb->string = eval_string;
|
||||
last_vb->cfg_table = *cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, type->count);
|
||||
}
|
||||
@@ -5287,6 +5290,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Links, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
{
|
||||
last_vb->eval = udt_eval;
|
||||
last_vb->string = eval_string;
|
||||
last_vb->cfg_table = *cfg_table;
|
||||
last_vb->link_member_type_key = link_member->type_key;
|
||||
last_vb->link_member_off = link_member->off;
|
||||
@@ -5350,6 +5354,7 @@ df_append_viz_blocks_for_parent__rec(Arena *arena, DBGI_Scope *scope, DF_EvalVie
|
||||
DF_EvalVizBlock *last_vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Elements, key, df_expand_key_make(df_hash_from_expand_key(key), 0), depth+1);
|
||||
{
|
||||
last_vb->eval = arr_eval;
|
||||
last_vb->string = eval_string;
|
||||
last_vb->cfg_table = *cfg_table;
|
||||
last_vb->visual_idx_range = last_vb->semantic_idx_range = r1u64(0, array_count);
|
||||
}
|
||||
@@ -5411,10 +5416,11 @@ df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DBGI_Scope *scope,
|
||||
{
|
||||
DF_Eval eval = df_eval_from_string(arena, scope, ctrl_ctx, parse_ctx, macro_map, expr);
|
||||
U64 expr_comma_pos = str8_find_needle(expr, 0, str8_lit(","), 0);
|
||||
U64 passthrough_pos = str8_find_needle(expr, 0, str8_lit("--"), 0);
|
||||
String8List default_view_rules = {0};
|
||||
if(expr_comma_pos < expr.size)
|
||||
if(expr_comma_pos < expr.size && expr_comma_pos < passthrough_pos)
|
||||
{
|
||||
String8 expr_extension = str8_skip(expr, expr_comma_pos+1);
|
||||
String8 expr_extension = str8_substr(expr, r1u64(expr_comma_pos+1, passthrough_pos));
|
||||
expr_extension = str8_skip_chop_whitespace(expr_extension);
|
||||
if(str8_match(expr_extension, str8_lit("x"), StringMatchFlag_CaseInsensitive))
|
||||
{
|
||||
@@ -5428,11 +5434,19 @@ df_eval_viz_block_list_from_eval_view_expr_keys(Arena *arena, DBGI_Scope *scope,
|
||||
{
|
||||
str8_list_pushf(arena, &default_view_rules, "oct");
|
||||
}
|
||||
else
|
||||
else if(expr_extension.size != 0)
|
||||
{
|
||||
str8_list_pushf(arena, &default_view_rules, "array:{%S}", expr_extension);
|
||||
}
|
||||
}
|
||||
if(passthrough_pos < expr.size)
|
||||
{
|
||||
String8 passthrough_view_rule = str8_skip_chop_whitespace(str8_skip(expr, passthrough_pos+2));
|
||||
if(passthrough_view_rule.size != 0)
|
||||
{
|
||||
str8_list_push(arena, &default_view_rules, passthrough_view_rule);
|
||||
}
|
||||
}
|
||||
String8 view_rule_string = df_eval_view_rule_from_key(eval_view, key);
|
||||
DF_CfgTable view_rule_table = {0};
|
||||
for(String8Node *n = default_view_rules.first; n != 0; n = n->next)
|
||||
|
||||
@@ -268,7 +268,7 @@ struct DF_Eval
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(name) DF_Eval name(Arena *arena, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, struct DF_CfgVal *val)
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name) df_core_view_rule_eval_resolution__##name
|
||||
#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name))
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_EvalView *eval_view, DF_Eval eval, struct DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, struct DF_CfgNode *cfg, struct DF_EvalVizBlockList *out)
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_EvalView *eval_view, DF_Eval eval, String8 string, struct DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, struct DF_CfgNode *cfg, struct DF_EvalVizBlockList *out)
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name) df_core_view_rule_viz_block_prod__##name
|
||||
#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name))
|
||||
typedef DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CoreViewRuleEvalResolutionHookFunctionType);
|
||||
@@ -774,7 +774,8 @@ struct DF_EvalVizRow
|
||||
DF_Eval eval;
|
||||
|
||||
// rjf: basic visualization contents
|
||||
String8 expr;
|
||||
String8 display_expr;
|
||||
String8 edit_expr;
|
||||
String8 display_value;
|
||||
String8 edit_value;
|
||||
TG_KeyList inherited_type_key_chain;
|
||||
|
||||
+16
-8
@@ -5127,7 +5127,7 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
//- rjf: calculate width of exp row
|
||||
if(row == viz_rows.first)
|
||||
{
|
||||
expr_column_width_px = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), row->expr).x + ui_top_font_size()*0.5f;
|
||||
expr_column_width_px = f_dim_from_tag_size_string(ui_top_font(), ui_top_font_size(), row->display_expr).x + ui_top_font_size()*0.5f;
|
||||
expr_column_width_px = Max(expr_column_width_px, ui_top_font_size()*10.f);
|
||||
}
|
||||
|
||||
@@ -5176,7 +5176,7 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D
|
||||
}
|
||||
UI_WidthFill
|
||||
{
|
||||
UI_PrefWidth(ui_px(expr_column_width_px, 1.f)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row->expr);
|
||||
UI_PrefWidth(ui_px(expr_column_width_px, 1.f)) df_code_label(1.f, 1, df_rgba_from_theme_color(DF_ThemeColor_CodeDefault), row->display_expr);
|
||||
ui_spacer(ui_em(1.5f, 1.f));
|
||||
if(row->flags & DF_EvalVizRowFlag_CanEditValue)
|
||||
{
|
||||
@@ -7226,7 +7226,8 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, block->eval, block->member, &block->cfg_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, block->eval, block->member, &block->cfg_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, block->key, block->eval);
|
||||
row->expr = block->string;
|
||||
row->display_expr = block->string;
|
||||
row->edit_expr = block->string;
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
row->edit_value = str8_list_join(arena, &edit_strings, 0);
|
||||
row->value_ui_rule_node = value_ui_rule_node;
|
||||
@@ -7286,7 +7287,8 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
{
|
||||
row->flags |= DF_EvalVizRowFlag_ExprIsSpecial;
|
||||
}
|
||||
row->expr = push_str8_copy(arena, member->name);
|
||||
row->display_expr = push_str8_copy(arena, member->name);
|
||||
row->edit_expr = push_str8f(arena, "%S.%S", block->string, member->name);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
row->edit_value = str8_list_join(arena, &edit_strings, 0);
|
||||
row->value_ui_rule_node = value_ui_rule_node;
|
||||
@@ -7336,7 +7338,8 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, eval, 0, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, eval, 0, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, eval);
|
||||
row->expr = push_str8_copy(arena, enum_val->name);
|
||||
row->display_expr = push_str8_copy(arena, enum_val->name);
|
||||
row->edit_expr = row->display_expr;
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
row->edit_value = str8_list_join(arena, &edit_strings, 0);
|
||||
row->value_ui_rule_node = value_ui_rule_node;
|
||||
@@ -7383,7 +7386,8 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, elem_eval, 0, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, elem_eval, 0, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, elem_eval);
|
||||
row->expr = push_str8f(arena, "[%I64u]", idx);
|
||||
row->display_expr = push_str8f(arena, "[%I64u]", idx);
|
||||
row->edit_expr = push_str8f(arena, "%S[%I64u]", block->string, idx);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
row->edit_value = str8_list_join(arena, &edit_strings, 0);
|
||||
row->value_ui_rule_node = value_ui_rule_node;
|
||||
@@ -7404,6 +7408,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
{
|
||||
DF_EvalLinkBaseChunkList link_base_chunks = df_eval_link_base_chunk_list_from_eval(scratch.arena, parse_ctx->type_graph, parse_ctx->rdi, block->link_member_type_key, block->link_member_off, ctrl_ctx, block->eval, 512);
|
||||
DF_EvalLinkBaseArray link_bases = df_eval_link_base_array_from_chunk_list(scratch.arena, &link_base_chunks);
|
||||
String8 node_type_string = tg_string_from_key(arena, parse_ctx->type_graph, parse_ctx->rdi, block->eval.type_key);
|
||||
for(U64 idx = visible_idx_range.min; idx < visible_idx_range.max; idx += 1)
|
||||
{
|
||||
// rjf: get key for this row
|
||||
@@ -7434,7 +7439,8 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, link_eval, 0, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, link_eval, 0, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, link_eval);
|
||||
row->expr = push_str8f(arena, "[%I64u]", idx);
|
||||
row->display_expr = push_str8f(arena, "[%I64u]", idx);
|
||||
row->edit_expr = push_str8f(arena, "(%S *)0xI64x", node_type_string, link_eval.offset);
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
row->edit_value = str8_list_join(arena, &edit_strings, 0);
|
||||
row->value_ui_rule_node = value_ui_rule_node;
|
||||
@@ -7457,6 +7463,7 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
DF_ExpandKey key = df_expand_key_make(df_hash_from_expand_key(block->parent_key), 1);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, block->eval);
|
||||
row->flags = DF_EvalVizRowFlag_Canvas;
|
||||
row->edit_expr = block->string;
|
||||
row->size_in_rows = dim_1u64(intersect_1u64(visible_idx_range, r1u64(0, dim_1u64(block->visual_idx_range))));
|
||||
row->skipped_size_in_rows= (visible_idx_range.min > block->visual_idx_range.min) ? visible_idx_range.min - block->visual_idx_range.min : 0;
|
||||
row->chopped_size_in_rows= (visible_idx_range.max < block->visual_idx_range.max) ? block->visual_idx_range.max - visible_idx_range.max : 0;
|
||||
@@ -7496,7 +7503,8 @@ df_eval_viz_windowed_row_list_from_viz_block_list(Arena *arena, DBGI_Scope *scop
|
||||
String8List display_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, DF_EvalVizStringFlag_ReadOnlyDisplayRules, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, eval, 0, &view_rule_table);
|
||||
String8List edit_strings = df_single_line_eval_value_strings_from_eval(scratch.arena, 0, parse_ctx->type_graph, parse_ctx->rdi, ctrl_ctx, default_radix, font, font_size, 500, 0, eval, 0, &view_rule_table);
|
||||
DF_EvalVizRow *row = df_eval_viz_row_list_push_new(arena, parse_ctx, &list, block, key, eval);
|
||||
row->expr = name;
|
||||
row->display_expr = name;
|
||||
row->edit_expr = name;
|
||||
row->display_value = str8_list_join(arena, &display_strings, 0);
|
||||
row->edit_value = str8_list_join(arena, &edit_strings, 0);
|
||||
row->value_ui_rule_node = value_ui_rule_node;
|
||||
|
||||
+1
-1
@@ -296,7 +296,7 @@ enum
|
||||
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name) df_gfx_view_rule_row_ui__##name
|
||||
#define DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_ROW_UI_FUNCTION_NAME(name))
|
||||
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg, Vec2F32 dim)
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(name) void name(struct DF_Window *ws, DF_ExpandKey key, DF_Eval eval, String8 string, DBGI_Scope *dbgi_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_CfgNode *cfg, Vec2F32 dim)
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name) df_gfx_view_rule_block_ui__##name
|
||||
#define DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_DEF(name) DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_SIG(DF_GFX_VIEW_RULE_BLOCK_UI_FUNCTION_NAME(name))
|
||||
|
||||
|
||||
@@ -515,6 +515,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(rgba)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -681,6 +682,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(text)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -798,6 +800,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(disasm)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -967,6 +970,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(bitmap)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 8);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
@@ -1204,6 +1208,7 @@ DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(geo)
|
||||
{
|
||||
DF_EvalVizBlock *vb = df_eval_viz_block_begin(arena, DF_EvalVizBlockKind_Canvas, key, df_expand_key_make(df_hash_from_expand_key(key), 1), depth);
|
||||
vb->eval = eval;
|
||||
vb->string = string;
|
||||
vb->cfg_table = *cfg_table;
|
||||
vb->visual_idx_range = r1u64(0, 16);
|
||||
vb->semantic_idx_range = r1u64(0, 1);
|
||||
|
||||
+19
-10
@@ -997,7 +997,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
for(DF_EvalVizRow *row = rows.first; row != 0; row = row->next, semantic_idx += 1)
|
||||
{
|
||||
U64 row_hash = df_hash_from_expand_key(row->key);
|
||||
U64 expr_hash = df_hash_from_string(row->expr);
|
||||
U64 expr_hash = df_hash_from_string(row->display_expr);
|
||||
df_expand_tree_table_animate(&eval_view->expand_tree_table, df_dt());
|
||||
B32 row_selected = ((semantic_idx+1) == cursor_tbl.y);
|
||||
B32 row_expanded = df_expand_key_is_set(&eval_view->expand_tree_table, row->key);
|
||||
@@ -1037,6 +1037,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
//- rjf: build canvas row
|
||||
if(row->flags & DF_EvalVizRowFlag_Canvas) UI_FocusHot(row_selected ? UI_FocusKind_On : UI_FocusKind_Off) ProfScope("canvas row")
|
||||
{
|
||||
//- rjf: build
|
||||
ui_set_next_flags(disabled_flags);
|
||||
ui_set_next_pref_width(ui_pct(1, 0));
|
||||
ui_set_next_pref_height(ui_px(scroll_list_params.row_height_px*row->size_in_rows, 1.f));
|
||||
@@ -1053,21 +1054,29 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
{
|
||||
Vec2F32 canvas_dim = v2f32(scroll_list_params.dim_px.x - ui_top_font_size()*1.5f,
|
||||
(row->skipped_size_in_rows+row->size_in_rows+row->chopped_size_in_rows)*scroll_list_params.row_height_px);
|
||||
row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->expand_ui_rule_node, canvas_dim);
|
||||
row->expand_ui_rule_spec->info.block_ui(ws, row->key, row->eval, row->edit_expr, scope, &ctrl_ctx, &parse_ctx, ¯o_map, row->expand_ui_rule_node, canvas_dim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: take interaction
|
||||
UI_Signal sig = ui_signal_from_box(vector);
|
||||
|
||||
//- rjf: press -> focus
|
||||
if(ui_pressed(sig))
|
||||
{
|
||||
edit_commit = edit_commit || (!row_selected && ewv->input_editing);
|
||||
next_cursor_tbl = v2s64(DF_EvalWatchViewColumnKind_Expr, (semantic_idx+1));
|
||||
pressed = 1;
|
||||
}
|
||||
if(ui_double_clicked(sig))
|
||||
|
||||
//- rjf: double clicked or keyboard clicked -> open dedicated tab
|
||||
if(ui_double_clicked(sig) || sig.f & UI_SignalFlag_KeyboardPressed)
|
||||
{
|
||||
DF_CmdParams p = df_cmd_params_from_view(ws, panel, view);
|
||||
p.string = row->edit_expr;
|
||||
p.view_spec = df_view_spec_from_gfx_view_kind(DF_GfxViewKind_EvalViewer);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_String);
|
||||
df_cmd_params_mark_slot(&p, DF_CmdParamSlot_ViewSpec);
|
||||
df_push_cmd__root(&p, df_cmd_spec_from_core_cmd_kind(DF_CoreCmdKind_OpenTab));
|
||||
}
|
||||
@@ -1130,8 +1139,8 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
if(cell_selected && (edit_begin || (edit_begin_or_expand && !(row->flags & DF_EvalVizRowFlag_CanExpand))) && can_edit_expr)
|
||||
{
|
||||
ewv->input_editing = 1;
|
||||
ewv->input_size = Min(sizeof(ewv->input_buffer), row->expr.size);
|
||||
MemoryCopy(ewv->input_buffer, row->expr.str, ewv->input_size);
|
||||
ewv->input_size = Min(sizeof(ewv->input_buffer), row->display_expr.size);
|
||||
MemoryCopy(ewv->input_buffer, row->display_expr.str, ewv->input_size);
|
||||
ewv->input_cursor = txt_pt(1, 1+ewv->input_size);
|
||||
ewv->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
@@ -1163,7 +1172,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
FuzzyMatchRangeList matches = {0};
|
||||
if(filter.size != 0)
|
||||
{
|
||||
matches = fuzzy_match_find(scratch.arena, filter, row->expr);
|
||||
matches = fuzzy_match_find(scratch.arena, filter, row->display_expr);
|
||||
}
|
||||
sig = df_line_editf((DF_LineEditFlag_CodeContents*(!(row->flags & DF_EvalVizRowFlag_ExprIsSpecial))|
|
||||
DF_LineEditFlag_NoBackground*(!is_inherited)|
|
||||
@@ -1174,7 +1183,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
row->depth,
|
||||
filter.size ? &matches : 0,
|
||||
&ewv->input_cursor, &ewv->input_mark, ewv->input_buffer, sizeof(ewv->input_buffer), &ewv->input_size, &next_expanded,
|
||||
row->expr,
|
||||
row->display_expr,
|
||||
"###row_%I64x", row_hash);
|
||||
}
|
||||
edit_commit = edit_commit || ui_committed(sig);
|
||||
@@ -1206,7 +1215,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
if(DEV_eval_compiler_tooltips && row->depth == 0 && ui_hovering(sig)) UI_Tooltip
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
String8 string = row->expr;
|
||||
String8 string = row->display_expr;
|
||||
|
||||
// rjf: lex & parse
|
||||
EVAL_TokenArray tokens = eval_token_array_from_text(scratch.arena, string);
|
||||
@@ -1270,8 +1279,8 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW
|
||||
{
|
||||
ui_kill_action();
|
||||
ewv->input_editing = 1;
|
||||
ewv->input_size = Min(sizeof(ewv->input_buffer), row->expr.size);
|
||||
MemoryCopy(ewv->input_buffer, row->expr.str, ewv->input_size);
|
||||
ewv->input_size = Min(sizeof(ewv->input_buffer), row->display_expr.size);
|
||||
MemoryCopy(ewv->input_buffer, row->display_expr.str, ewv->input_size);
|
||||
ewv->input_cursor = txt_pt(1, 1+ewv->input_size);
|
||||
ewv->input_mark = txt_pt(1, 1);
|
||||
}
|
||||
|
||||
@@ -414,6 +414,14 @@ eval_token_array_from_text(Arena *arena, String8 text)
|
||||
eval_token_chunk_list_push(scratch.arena, &tokens, 256, &token);
|
||||
}
|
||||
|
||||
// rjf: symbolic strings matching `--` mean the remainder of the string
|
||||
// is reserved for external usage. the rest of the stream should not
|
||||
// be tokenized.
|
||||
else if(idx == active_token_start_idx+2 && text.str[active_token_start_idx] == '-' && text.str[active_token_start_idx+1] == '-')
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// rjf: if we got a symbol string of N>1 characters, then we need to
|
||||
// apply the maximum-munch rule, and produce M<=N tokens, where each
|
||||
// formed token is the maximum size possible, given the legal
|
||||
|
||||
Reference in New Issue
Block a user