further progress on eliminating file entities; further entity simplification; set up external identifier resolution map for evaluating 'meta' variables; sketch out generalized entity serialization path

This commit is contained in:
Ryan Fleury
2024-08-13 11:39:25 -07:00
parent 057d4d485e
commit 6d30455e76
17 changed files with 467 additions and 359 deletions
+19 -1
View File
@@ -1174,6 +1174,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
REGS_AliasCode alias_code = 0;
E_TypeKey type_key = zero_struct;
String8 local_lookup_string = token_string;
U64 ext_num = 0;
//- rjf: form namespaceified fallback versions of this lookup string
String8List namespaceified_token_strings = {0};
@@ -1413,6 +1414,16 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
}
}
//- rjf: try external map
if(mapped_identifier == 0)
{
ext_num = e_num_from_string(e_parse_ctx->ext_map, token_string);
if(ext_num != 0)
{
mapped_identifier = 1;
}
}
//- rjf: try types
if(mapped_identifier == 0)
{
@@ -1434,7 +1445,14 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
{
default:
{
if(identifier_looks_like_type_expr)
if(ext_num != 0)
{
atom = e_push_expr(arena, E_ExprKind_LeafExt, token_string.str);
atom->mode = E_Mode_Ext;
atom->string = token_string;
atom->u64 = ext_num;
}
else if(identifier_looks_like_type_expr)
{
E_TokenArray type_parse_tokens = e_token_array_make_first_opl(it-1, it_opl);
E_Parse type_parse = e_parse_type_from_text_tokens(arena, text, &type_parse_tokens);