mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-01 11:48:10 +00:00
adjust block tree building from being on expr -> being on eval
This commit is contained in:
@@ -33,10 +33,14 @@ e_eval_from_expr(Arena *arena, E_Expr *expr)
|
||||
internal E_Eval
|
||||
e_eval_from_string(Arena *arena, String8 string)
|
||||
{
|
||||
ProfBeginFunction();
|
||||
ProfBegin("e_eval_from_string (%.*s)", str8_varg(string));
|
||||
E_TokenArray tokens = e_token_array_from_text(arena, string);
|
||||
E_Parse parse = e_parse_expr_from_text_tokens(arena, string, tokens);
|
||||
E_Eval eval = e_eval_from_expr(arena, parse.expr);
|
||||
e_msg_list_concat_in_place(&eval.msgs, &parse.msgs);
|
||||
ProfEnd();
|
||||
ProfEnd();
|
||||
return eval;
|
||||
}
|
||||
|
||||
@@ -217,6 +221,14 @@ e_value_from_expr(E_Expr *expr)
|
||||
return result;
|
||||
}
|
||||
|
||||
internal E_Value
|
||||
e_value_from_eval(E_Eval eval)
|
||||
{
|
||||
E_Eval value_eval = e_value_eval_from_eval(eval);
|
||||
E_Value result = value_eval.value;
|
||||
return result;
|
||||
}
|
||||
|
||||
internal E_Eval
|
||||
e_eval_wrap(Arena *arena, E_Eval eval, String8 string)
|
||||
{
|
||||
|
||||
+1
-20
@@ -4,26 +4,6 @@
|
||||
#ifndef EVAL_BUNDLES_H
|
||||
#define EVAL_BUNDLES_H
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Bundled Evaluation Path Types
|
||||
|
||||
typedef struct E_Eval E_Eval;
|
||||
struct E_Eval
|
||||
{
|
||||
E_Value value;
|
||||
E_Space space;
|
||||
E_Expr *expr;
|
||||
E_IRTreeAndType irtree;
|
||||
String8 bytecode;
|
||||
E_InterpretationCode code;
|
||||
E_MsgList msgs;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
read_only global E_Eval e_eval_nil = {zero_struct, zero_struct, &e_expr_nil, {&e_irnode_nil}};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Bundled Evaluation Functions
|
||||
|
||||
@@ -35,6 +15,7 @@ internal E_Eval e_value_eval_from_eval(E_Eval eval);
|
||||
internal E_Value e_value_from_string(String8 string);
|
||||
internal E_Value e_value_from_stringf(char *fmt, ...);
|
||||
internal E_Value e_value_from_expr(E_Expr *expr);
|
||||
internal E_Value e_value_from_eval(E_Eval eval);
|
||||
internal E_Eval e_eval_wrap(Arena *arena, E_Eval eval, String8 string);
|
||||
internal E_Eval e_eval_wrapf(Arena *arena, E_Eval eval, char *fmt, ...);;
|
||||
|
||||
|
||||
+21
-1
@@ -303,6 +303,21 @@ struct E_IRTreeAndType
|
||||
E_IRTreeAndType *prev;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Evaluation Artifact Bundle
|
||||
|
||||
typedef struct E_Eval E_Eval;
|
||||
struct E_Eval
|
||||
{
|
||||
E_Value value;
|
||||
E_Space space;
|
||||
E_Expr *expr;
|
||||
E_IRTreeAndType irtree;
|
||||
String8 bytecode;
|
||||
E_InterpretationCode code;
|
||||
E_MsgList msgs;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Full Extracted Type Information Types
|
||||
|
||||
@@ -628,7 +643,12 @@ struct E_BaseCtx
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
global read_only E_Module e_module_nil = {&rdi_parsed_nil};
|
||||
read_only global E_String2NumMap e_string2num_map_nil = {0};
|
||||
read_only global E_String2ExprMap e_string2expr_map_nil = {0};
|
||||
read_only global E_Expr e_expr_nil = {&e_expr_nil, &e_expr_nil, &e_expr_nil, &e_expr_nil, &e_expr_nil};
|
||||
read_only global E_IRNode e_irnode_nil = {&e_irnode_nil, &e_irnode_nil, &e_irnode_nil};
|
||||
read_only global E_Eval e_eval_nil = {zero_struct, zero_struct, &e_expr_nil, {&e_irnode_nil}};
|
||||
read_only global E_Module e_module_nil = {&rdi_parsed_nil};
|
||||
thread_static E_BaseCtx *e_base_ctx = 0;
|
||||
thread_static U64 e_base_ctx_gen = 0;
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ struct E_IRState
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
global read_only E_IRNode e_irnode_nil = {&e_irnode_nil, &e_irnode_nil, &e_irnode_nil};
|
||||
thread_static E_IRState *e_ir_state = 0;
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
@@ -29,9 +29,7 @@ struct E_ParseState
|
||||
////////////////////////////////
|
||||
//~ rjf: Globals
|
||||
|
||||
global read_only E_String2NumMap e_string2num_map_nil = {0};
|
||||
global read_only E_String2ExprMap e_string2expr_map_nil = {0};
|
||||
global read_only E_Expr e_expr_nil = {&e_expr_nil, &e_expr_nil, &e_expr_nil, &e_expr_nil, &e_expr_nil};
|
||||
|
||||
thread_static E_ParseState *e_parse_state = 0;
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user