fix block type extraction in row build; the block tree build resolves evals to whatever types it is using for expansion, but sometimes we need to see types which have been stripped for row building (e.g. tables)

This commit is contained in:
Ryan Fleury
2025-04-29 09:01:09 -07:00
parent 71bdeb8f92
commit bc67abe4ca
4 changed files with 34 additions and 5 deletions
+28 -3
View File
@@ -86,6 +86,13 @@ e_key_match(E_Key a, E_Key b)
return result;
}
internal E_Key
e_key_zero(void)
{
E_Key key = {0};
return key;
}
////////////////////////////////
//~ rjf: Type Key Type Functions
@@ -883,6 +890,27 @@ e_interpretation_from_bundle(E_CacheBundle *bundle)
return interpret;
}
//- rjf: key -> full expression string
internal String8
e_full_expr_string_from_key(Arena *arena, E_Key key)
{
E_CacheBundle *bundle = e_cache_bundle_from_key(key);
String8 result = push_str8_copy(arena, bundle->string);
if(!e_key_match(bundle->parent_key, e_key_zero()))
{
Temp scratch = scratch_begin(&arena, 1);
typedef struct ParentResolveTask ParentResolveTask;
struct ParentResolveTask
{
ParentResolveTask *next;
E_Key key;
};
scratch_end(scratch);
}
return result;
}
//- rjf: comprehensive bundle
internal E_Eval
@@ -961,9 +989,6 @@ e_value_eval_from_eval(E_Eval eval)
return eval;
}
//- rjf: string-based helpers
// TODO(rjf): (replace the old bundle APIs here)
//- rjf: type key -> auto hooks
internal E_ExprList
+4
View File
@@ -1016,6 +1016,7 @@ internal B32 e_expr_kind_is_comparison(E_ExprKind kind);
//~ rjf: Key Type Functions
internal B32 e_key_match(E_Key a, E_Key b);
internal E_Key e_key_zero(void);
////////////////////////////////
//~ rjf: Type Key Type Functions
@@ -1131,6 +1132,9 @@ internal E_Interpretation e_interpretation_from_bundle(E_CacheBundle *bundle);
#define e_bytecode_from_key(key) e_bytecode_from_bundle(e_cache_bundle_from_key(key))
#define e_interpretation_from_key(key) e_interpretation_from_bundle(e_cache_bundle_from_key(key))
//- rjf: key -> full expression string
internal String8 e_full_expr_string_from_key(Arena *arena, E_Key key);
//- rjf: comprehensive bundle
internal E_Eval e_eval_from_bundle(E_CacheBundle *bundle);
internal E_Eval e_value_eval_from_eval(E_Eval eval);
+1 -1
View File
@@ -2251,7 +2251,7 @@ E_TYPE_EXPAND_INFO_FUNCTION_DEF(omit)
Temp scratch = scratch_begin(&arena, 1);
String8List allowed_children = {0};
{
E_Eval eval_stripped = e_eval_wrapf(eval, "raw($)");
E_Eval eval_stripped = e_eval_wrapf(eval, "q:raw($)");
E_TypeExpandRule *expand_rule = e_expand_rule_from_type_key(eval_stripped.irtree.type_key);
E_TypeExpandInfo expand_info = expand_rule->info(scratch.arena, eval_stripped, filter);
if(expand_info.expr_count < 4096)
+1 -1
View File
@@ -944,7 +944,7 @@ rd_watch_row_info_from_row(Arena *arena, EV_Row *row)
E_Type *row_type = e_type_from_key__cached(row->eval.irtree.type_key);
EV_Key key = row->key;
EV_Block *block = row->block;
E_Eval block_eval = row->block->eval;
E_Eval block_eval = e_eval_from_key(row->block->eval.key);
E_TypeKey block_type_key = e_type_key_unwrap(block_eval.irtree.type_key, E_TypeUnwrapFlag_Meta);
E_TypeKind block_type_kind = e_type_kind_from_key(block_type_key);
E_Type *block_type = e_type_from_key__cached(block_type_key);