pass over help menu; typeof in eval

This commit is contained in:
Ryan Fleury
2024-10-10 07:44:26 -07:00
parent 848b26bbd9
commit 9c5d9caa32
10 changed files with 79 additions and 39 deletions
+2 -2
View File
@@ -157,8 +157,8 @@ struct_members(CTRL_ModuleMetaEval)
{
member_lit_comp(CTRL_MetaEval, type(U32), color, .pretty_name = str8_lit_comp("Color")),
member_lit_comp(CTRL_MetaEval, type(CTRL_CodeString8), label, .pretty_name = str8_lit_comp("Name")),
member_lit_comp(CTRL_MetaEval, type(CTRL_PlainString8),exe, .pretty_name = str8_lit_comp("Executable Path")),
member_lit_comp(CTRL_MetaEval, type(CTRL_PlainString8),dbg, .pretty_name = str8_lit_comp("Debug Info Path")),
member_lit_comp(CTRL_MetaEval, type(CTRL_PathString8), exe, .pretty_name = str8_lit_comp("Executable Path")),
member_lit_comp(CTRL_MetaEval, type(CTRL_PathString8), dbg, .pretty_name = str8_lit_comp("Debug Info Path")),
member_lit_comp(CTRL_MetaEval, type(Rng1U64), vaddr_range, .pretty_name = str8_lit_comp("Address Range")),
};
+12 -11
View File
@@ -52,14 +52,14 @@ E_TypeKindTable:
{ComplexF64 "ComplexF64" 16 }
{ComplexF80 "ComplexF80" 20 }
{ComplexF128 "ComplexF128" 32 }
{Modifier "" 0 }
{Ptr "" 0 }
{LRef "" 0 }
{RRef "" 0 }
{Array "" 0 }
{Function "" 0 }
{Method "" 0 }
{MemberPtr "" 0 }
{Modifier "modifier" 0 }
{Ptr "ptr" 0 }
{LRef "lref" 0 }
{RRef "rref" 0 }
{Array "array" 0 }
{Function "function" 0 }
{Method "method" 0 }
{MemberPtr "member_ptr" 0 }
{Struct "struct" 0 }
{Class "class" 0 }
{Union "union" 0 }
@@ -69,9 +69,9 @@ E_TypeKindTable:
{IncompleteUnion "union" 0 }
{IncompleteClass "class" 0 }
{IncompleteEnum "enum" 0 }
{Bitfield "" 0 }
{Variadic "" 0 }
{Collection "" 0 }
{Bitfield "bitfield" 0 }
{Variadic "variadic" 0 }
{Collection "collection" 0 }
}
@table(name op_kind precedence string op_pre op_sep op_pos)
@@ -87,6 +87,7 @@ E_ExprKindTable:
{ Cast Null 1 "cast" "(" ")" "" }
{ Sizeof UnaryPrefix 1 "sizeof" "sizeof" "" "" }
{ Typeof UnaryPrefix 1 "typeof" "typeof" "" "" }
{ ByteSwap UnaryPrefix 1 "bswap" "bswap" "(" ")"}
{ Neg UnaryPrefix 2 "-" "-" "" "" }
+15
View File
@@ -806,6 +806,21 @@ e_irtree_and_type_from_expr(Arena *arena, E_Expr *expr)
}
}break;
//- rjf: typeof
case E_ExprKind_Typeof:
{
// rjf: evaluate operand tree
E_Expr *r_expr = expr->first;
E_IRTreeAndType r_tree = e_irtree_and_type_from_expr(arena, r_expr);
e_msg_list_concat_in_place(&result.msgs, &r_tree.msgs);
// rjf: fill output
result.root = &e_irnode_nil;
result.type_key = r_tree.type_key;
result.mode = E_Mode_Null;
result.space = r_tree.space;
}break;
//- rjf: byteswap
case E_ExprKind_ByteSwap:
{
+15 -13
View File
@@ -14,7 +14,7 @@ str8_lit_comp("CharLiteral"),
str8_lit_comp("Symbol"),
};
String8 e_expr_kind_strings[46] =
String8 e_expr_kind_strings[47] =
{
str8_lit_comp("Nil"),
str8_lit_comp("Ref"),
@@ -24,6 +24,7 @@ str8_lit_comp("Deref"),
str8_lit_comp("Address"),
str8_lit_comp("Cast"),
str8_lit_comp("Sizeof"),
str8_lit_comp("Typeof"),
str8_lit_comp("ByteSwap"),
str8_lit_comp("Neg"),
str8_lit_comp("LogNot"),
@@ -79,7 +80,7 @@ str8_lit_comp("Insufficient evaluation machine stack space."),
str8_lit_comp("Malformed bytecode."),
};
E_OpInfo e_expr_kind_op_info_table[46] =
E_OpInfo e_expr_kind_op_info_table[47] =
{
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("") },
{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("") },
@@ -89,6 +90,7 @@ E_OpInfo e_expr_kind_op_info_table[46] =
{ E_OpKind_UnaryPrefix, 2, str8_lit_comp("&"), str8_lit_comp(""), str8_lit_comp("") },
{ E_OpKind_Null, 1, str8_lit_comp("("), str8_lit_comp(")"), str8_lit_comp("") },
{ E_OpKind_UnaryPrefix, 1, str8_lit_comp("sizeof"), str8_lit_comp(""), str8_lit_comp("") },
{ E_OpKind_UnaryPrefix, 1, str8_lit_comp("typeof"), str8_lit_comp(""), str8_lit_comp("") },
{ E_OpKind_UnaryPrefix, 1, str8_lit_comp("bswap"), str8_lit_comp("("), str8_lit_comp(")") },
{ E_OpKind_UnaryPrefix, 2, str8_lit_comp("-"), str8_lit_comp(""), str8_lit_comp("") },
{ E_OpKind_UnaryPrefix, 2, str8_lit_comp("!"), str8_lit_comp(""), str8_lit_comp("") },
@@ -227,14 +229,14 @@ str8_lit_comp("ComplexF32"),
str8_lit_comp("ComplexF64"),
str8_lit_comp("ComplexF80"),
str8_lit_comp("ComplexF128"),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp("modifier"),
str8_lit_comp("ptr"),
str8_lit_comp("lref"),
str8_lit_comp("rref"),
str8_lit_comp("array"),
str8_lit_comp("function"),
str8_lit_comp("method"),
str8_lit_comp("member_ptr"),
str8_lit_comp("struct"),
str8_lit_comp("class"),
str8_lit_comp("union"),
@@ -244,9 +246,9 @@ str8_lit_comp("struct"),
str8_lit_comp("union"),
str8_lit_comp("class"),
str8_lit_comp("enum"),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp(""),
str8_lit_comp("bitfield"),
str8_lit_comp("variadic"),
str8_lit_comp("collection"),
};
C_LINKAGE_END
+3 -2
View File
@@ -99,6 +99,7 @@ E_ExprKind_Deref,
E_ExprKind_Address,
E_ExprKind_Cast,
E_ExprKind_Sizeof,
E_ExprKind_Typeof,
E_ExprKind_ByteSwap,
E_ExprKind_Neg,
E_ExprKind_LogNot,
@@ -158,9 +159,9 @@ E_InterpretationCode_COUNT,
C_LINKAGE_BEGIN
extern String8 e_token_kind_strings[6];
extern String8 e_expr_kind_strings[46];
extern String8 e_expr_kind_strings[47];
extern String8 e_interpretation_code_display_strings[11];
extern E_OpInfo e_expr_kind_op_info_table[46];
extern E_OpInfo e_expr_kind_op_info_table[47];
extern U8 e_kind_basic_byte_size_table[56];
extern String8 e_kind_basic_string_table[56];
+6
View File
@@ -492,3 +492,9 @@ os_show_in_filesystem_ui(String8 path)
{
}
internal void
os_open_in_browser(String8 url)
{
}
+1
View File
@@ -192,5 +192,6 @@ internal void os_graphical_message(B32 error, String8 title, String8 m
//~ rjf: @os_hooks Shell Operations
internal void os_show_in_filesystem_ui(String8 path);
internal void os_open_in_browser(String8 url);
#endif // OS_GFX_H
+5
View File
@@ -238,3 +238,8 @@ internal void
os_show_in_filesystem_ui(String8 path)
{
}
internal void
os_open_in_browser(String8 url)
{
}
+9
View File
@@ -1542,3 +1542,12 @@ os_show_in_filesystem_ui(String8 path)
}
scratch_end(scratch);
}
internal void
os_open_in_browser(String8 url)
{
Temp scratch = scratch_begin(0, 0);
String16 url16 = str16_from_8(scratch.arena, url);
ShellExecuteW(0, L"open", (WCHAR *)url16.str, 0, 0, SW_SHOWNORMAL);
scratch_end(scratch);
}
+11 -11
View File
@@ -5293,6 +5293,7 @@ rd_window_frame(RD_Window *ws)
{
UI_Row UI_TextAlignment(UI_TextAlign_Center) UI_FlagsAdd(UI_BoxFlag_DrawTextWeak)
ui_label(str8_lit(BUILD_TITLE_STRING_LITERAL));
ui_spacer(ui_em(1.f, 1.f));
UI_PrefHeight(ui_children_sum(1)) UI_Row UI_Padding(ui_pct(1, 0))
{
R_Handle texture = rd_state->icon_texture;
@@ -5301,7 +5302,7 @@ rd_window_frame(RD_Window *ws)
UI_PrefHeight(ui_px(ui_top_font_size()*10.f, 1.f))
ui_image(texture, R_Tex2DSampleKind_Linear, r2f32p(0, 0, texture_dim.x, texture_dim.y), v4f32(1, 1, 1, 1), 0, str8_lit(""));
}
ui_spacer(ui_em(0.25f, 1.f));
ui_spacer(ui_em(1.f, 1.f));
UI_Row
UI_PrefWidth(ui_text_dim(10, 1))
UI_TextAlignment(UI_TextAlign_Center)
@@ -5312,20 +5313,19 @@ rd_window_frame(RD_Window *ws)
UI_TextAlignment(UI_TextAlign_Center)
rd_cmd_binding_buttons(rd_cmd_kind_info_table[RD_CmdKind_RunCommand].string);
}
ui_spacer(ui_em(0.25f, 1.f));
UI_Row UI_TextAlignment(UI_TextAlign_Center) ui_label(str8_lit("Submit issues to the GitHub at:"));
UI_TextAlignment(UI_TextAlign_Center)
ui_spacer(ui_em(1.f, 1.f));
RD_Palette(RD_PaletteCode_NeutralPopButton)
UI_Row UI_Padding(ui_pct(1, 0)) UI_TextAlignment(UI_TextAlign_Center) UI_PrefWidth(ui_text_dim(10, 1))
UI_CornerRadius(ui_top_font_size()*0.5f)
{
UI_Signal url_sig = ui_buttonf("github.com/EpicGames/raddebugger");
if(ui_hovering(url_sig)) UI_Tooltip
String8 url = str8_lit("https://github.com/EpicGamesExt/raddebugger/issues");
UI_Signal sig = ui_button(str8_lit("Submit Request, Issue, or Bug Report"));
if(ui_clicked(sig))
{
ui_labelf("Copy To Clipboard");
}
if(ui_clicked(url_sig))
{
os_set_clipboard_text(str8_lit("https://github.com/EpicGames/raddebugger"));
os_open_in_browser(url);
}
}
ui_spacer(ui_em(0.5f, 1.f));
}
// rjf: buttons