mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-31 03:10:03 +00:00
first step to collapsing separate view parameterization path, and just having views be parameterized by evaluation strings
This commit is contained in:
+1
-1
@@ -119,7 +119,7 @@ E_ExprKindTable:
|
||||
{ LeafF64 Null 0 "F64" "" "" "" }
|
||||
{ LeafF32 Null 0 "F32" "" "" "" }
|
||||
{ LeafIdent Null 0 "leaf_ident" "" "" "" }
|
||||
{ LeafID Null 0 "leaf_id" "" "" "" }
|
||||
{ LeafOffset Null 0 "leaf_offset" "" "" "" }
|
||||
{ LeafFilePath Null 0 "leaf_filepath" "" "" "" }
|
||||
|
||||
{ TypeIdent Null 0 "type_ident" "" "" "" }
|
||||
|
||||
@@ -46,6 +46,7 @@ union E_Value
|
||||
U64 u256[4];
|
||||
U128 u128;
|
||||
U64 u64;
|
||||
U32 u32;
|
||||
S64 s64;
|
||||
F64 f64;
|
||||
F32 f32;
|
||||
|
||||
+6
-6
@@ -1169,7 +1169,7 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *expr)
|
||||
//- rjf: leaf U64s
|
||||
case E_ExprKind_LeafU64:
|
||||
{
|
||||
U64 val = expr->u64;
|
||||
U64 val = expr->value.u64;
|
||||
E_IRNode *new_tree = e_irtree_const_u(arena, val);
|
||||
E_TypeKey type_key = zero_struct;
|
||||
if(0){}
|
||||
@@ -1184,7 +1184,7 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *expr)
|
||||
//- rjf: leaf F64s
|
||||
case E_ExprKind_LeafF64:
|
||||
{
|
||||
U64 val = expr->u64;
|
||||
U64 val = expr->value.u64;
|
||||
E_IRNode *new_tree = e_irtree_const_u(arena, val);
|
||||
result.root = new_tree;
|
||||
result.type_key = e_type_key_basic(E_TypeKind_F64);
|
||||
@@ -1194,7 +1194,7 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *expr)
|
||||
//- rjf: leaf F32s
|
||||
case E_ExprKind_LeafF32:
|
||||
{
|
||||
U32 val = expr->u32;
|
||||
U32 val = expr->value.u32;
|
||||
E_IRNode *new_tree = e_irtree_const_u(arena, val);
|
||||
result.root = new_tree;
|
||||
result.type_key = e_type_key_basic(E_TypeKind_F32);
|
||||
@@ -1217,11 +1217,11 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *expr)
|
||||
}
|
||||
}break;
|
||||
|
||||
//- rjf: leaf IDs (opaque u64s with type info attached)
|
||||
case E_ExprKind_LeafID:
|
||||
//- rjf: leaf offsets
|
||||
case E_ExprKind_LeafOffset:
|
||||
{
|
||||
E_IRNode *new_tree = e_push_irnode(arena, RDI_EvalOp_ConstU64);
|
||||
new_tree->value.u64 = expr->u64;
|
||||
new_tree->value.u64 = expr->value.u64;
|
||||
result.root = new_tree;
|
||||
result.type_key = expr->type_key;
|
||||
result.mode = E_Mode_Offset;
|
||||
|
||||
+13
-20
@@ -486,7 +486,7 @@ e_token_array_from_text(Arena *arena, String8 text)
|
||||
}break;
|
||||
case E_TokenKind_Numeric:
|
||||
{
|
||||
if(!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '.')
|
||||
if(!char_is_alpha(byte) && !char_is_digit(byte, 10) && byte != '.' && byte != ':')
|
||||
{
|
||||
advance = 0;
|
||||
token_formed = 1;
|
||||
@@ -680,7 +680,7 @@ e_expr_ref_array_index(Arena *arena, E_Expr *lhs, U64 index)
|
||||
E_Expr *root = e_push_expr(arena, E_ExprKind_ArrayIndex, 0);
|
||||
E_Expr *lhs_ref = e_expr_ref(arena, lhs);
|
||||
E_Expr *rhs = e_push_expr(arena, E_ExprKind_LeafU64, 0);
|
||||
rhs->u64 = index;
|
||||
rhs->value.u64 = index;
|
||||
e_expr_push_child(root, lhs_ref);
|
||||
e_expr_push_child(root, rhs);
|
||||
return root;
|
||||
@@ -744,19 +744,19 @@ e_append_strings_from_expr(Arena *arena, E_Expr *expr, String8List *out)
|
||||
}break;
|
||||
case E_ExprKind_LeafU64:
|
||||
{
|
||||
str8_list_pushf(arena, out, "%I64u", expr->u64);
|
||||
str8_list_pushf(arena, out, "%I64u", expr->value.u64);
|
||||
}break;
|
||||
case E_ExprKind_LeafID:
|
||||
case E_ExprKind_LeafOffset:
|
||||
{
|
||||
str8_list_pushf(arena, out, "0x%I64x", expr->u64);
|
||||
str8_list_pushf(arena, out, "0x%I64x", expr->value.u64);
|
||||
}break;
|
||||
case E_ExprKind_LeafF64:
|
||||
{
|
||||
str8_list_pushf(arena, out, "%f", expr->f64);
|
||||
str8_list_pushf(arena, out, "%f", expr->value.f64);
|
||||
}break;
|
||||
case E_ExprKind_LeafF32:
|
||||
{
|
||||
str8_list_pushf(arena, out, "%f", expr->f32);
|
||||
str8_list_pushf(arena, out, "%f", expr->value.f32);
|
||||
}break;
|
||||
case E_ExprKind_TypeIdent:
|
||||
{
|
||||
@@ -910,7 +910,7 @@ e_type_from_expr(E_Expr *expr)
|
||||
{
|
||||
E_Expr *child_expr = expr->first;
|
||||
E_TypeKey direct_type_key = e_type_from_expr(child_expr);
|
||||
result = e_type_key_cons_array(direct_type_key, expr->u64);
|
||||
result = e_type_key_cons_array(direct_type_key, expr->value.u64);
|
||||
}break;
|
||||
}
|
||||
return result;
|
||||
@@ -1688,15 +1688,8 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
{
|
||||
U64 val = 0;
|
||||
try_u64_from_str8_c_rules(token_string, &val);
|
||||
if(str8_match(resolution_qualifier, str8_lit("id"), 0))
|
||||
{
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafID, token_string.str);
|
||||
}
|
||||
else
|
||||
{
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafU64, token_string.str);
|
||||
}
|
||||
atom->u64 = val;
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafU64, token_string.str);
|
||||
atom->value.u64 = val;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1710,14 +1703,14 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
if(f_pos < token_string.size)
|
||||
{
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafF32, token_string.str);
|
||||
atom->f32 = (F32)val;
|
||||
atom->value.f32 = (F32)val;
|
||||
}
|
||||
|
||||
// rjf: no f => f64
|
||||
else
|
||||
{
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafF64, token_string.str);
|
||||
atom->f64 = val;
|
||||
atom->value.f64 = val;
|
||||
}
|
||||
}
|
||||
}break;
|
||||
@@ -1732,7 +1725,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to
|
||||
String8 char_literal_raw = e_raw_from_escaped_string(scratch.arena, char_literal_escaped);
|
||||
U8 char_val = char_literal_raw.size > 0 ? char_literal_raw.str[0] : 0;
|
||||
atom = e_push_expr(arena, E_ExprKind_LeafU64, token_string.str);
|
||||
atom->u64 = (U64)char_val;
|
||||
atom->value.u64 = (U64)char_val;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -59,10 +59,7 @@ struct E_Expr
|
||||
E_Mode mode;
|
||||
E_Space space;
|
||||
E_TypeKey type_key;
|
||||
U32 u32;
|
||||
F32 f32;
|
||||
U64 u64;
|
||||
F64 f64;
|
||||
E_Value value;
|
||||
String8 string;
|
||||
String8 bytecode;
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ str8_lit_comp("LeafU64"),
|
||||
str8_lit_comp("LeafF64"),
|
||||
str8_lit_comp("LeafF32"),
|
||||
str8_lit_comp("LeafIdent"),
|
||||
str8_lit_comp("LeafID"),
|
||||
str8_lit_comp("LeafOffset"),
|
||||
str8_lit_comp("LeafFilePath"),
|
||||
str8_lit_comp("TypeIdent"),
|
||||
str8_lit_comp("Ptr"),
|
||||
@@ -116,7 +116,7 @@ E_OpInfo e_expr_kind_op_info_table[44] =
|
||||
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("LeafF64") },
|
||||
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("LeafF32") },
|
||||
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("LeafIdent") },
|
||||
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("LeafID") },
|
||||
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("LeafOffset") },
|
||||
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("LeafFilePath") },
|
||||
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("TypeIdent") },
|
||||
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("Ptr") },
|
||||
|
||||
@@ -127,7 +127,7 @@ E_ExprKind_LeafU64,
|
||||
E_ExprKind_LeafF64,
|
||||
E_ExprKind_LeafF32,
|
||||
E_ExprKind_LeafIdent,
|
||||
E_ExprKind_LeafID,
|
||||
E_ExprKind_LeafOffset,
|
||||
E_ExprKind_LeafFilePath,
|
||||
E_ExprKind_TypeIdent,
|
||||
E_ExprKind_Ptr,
|
||||
|
||||
Reference in New Issue
Block a user