diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index ac4d7737..7019545e 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -2774,7 +2774,6 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS //- rjf: draw start of cache lines in expansions // if((row_eval.mode == E_Mode_Offset || row_eval.mode == E_Mode_Null) && - row_eval.msgs.count == 0 && row_eval.value.u64%64 == 0 && row->depth > 0 && !row_expanded) { @@ -2789,7 +2788,6 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS //- rjf: draw mid-row cache line boundaries in expansions // if((row_eval.mode == E_Mode_Offset || row_eval.mode == E_Mode_Null) && - row_eval.msgs.max_kind == E_MsgKind_Null && row_eval.value.u64%64 != 0 && row->depth > 0 && !row_expanded) @@ -2850,10 +2848,18 @@ df_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_WatchViewS }goto value_cell; value_cell:; { - if(cell_eval.msgs.max_kind > E_MsgKind_Null) + E_MsgList msgs = cell_eval.msgs; + if(row->depth == 0 && row->string.size != 0) + { + E_TokenArray tokens = e_token_array_from_text(scratch.arena, row->string); + E_Parse parse = e_parse_expr_from_text_tokens(scratch.arena, row->string, &tokens); + e_msg_list_concat_in_place(&parse.msgs, &msgs); + msgs = parse.msgs; + } + if(msgs.max_kind > E_MsgKind_Null) { String8List strings = {0}; - for(E_Msg *msg = cell_eval.msgs.first; msg != 0; msg = msg->next) + for(E_Msg *msg = msgs.first; msg != 0; msg = msg->next) { str8_list_push(scratch.arena, &strings, msg->text); } diff --git a/src/eval/eval.mdesk b/src/eval/eval.mdesk index f2738e7e..8747a105 100644 --- a/src/eval/eval.mdesk +++ b/src/eval/eval.mdesk @@ -84,8 +84,8 @@ E_ExprKindTable: { Deref UnaryPrefix 2 "*" "*" "" "" } { Address UnaryPrefix 2 "&" "&" "" "" } - { Cast Null 0 "cast" "" "" "" } - { Sizeof UnaryPrefix 0 "sizeof" "sizeof" "" "" } + { Cast Null 1 "cast" "" "" "" } + { Sizeof UnaryPrefix 1 "sizeof" "sizeof" "" "" } { Neg UnaryPrefix 2 "-" "-" "" "" } { LogNot UnaryPrefix 2 "!" "!" "" "" } diff --git a/src/eval/eval_parse.c b/src/eval/eval_parse.c index d84c6b19..ce367699 100644 --- a/src/eval/eval_parse.c +++ b/src/eval/eval_parse.c @@ -1191,14 +1191,21 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to it = nested_parse.last_token; // rjf: build cast-to-U64*, and dereference operators - E_Expr *type = e_push_expr(arena, E_ExprKind_TypeIdent, token_string.str); - type->type_key = e_type_key_cons_ptr(e_type_key_basic(E_TypeKind_U64)); - E_Expr *casted = atom; - E_Expr *cast = e_push_expr(arena, E_ExprKind_Cast, token_string.str); - e_expr_push_child(cast, type); - e_expr_push_child(cast, casted); - atom = e_push_expr(arena, E_ExprKind_Deref, token_string.str); - e_expr_push_child(atom, cast); + if(nested_parse.expr == &e_expr_nil) + { + e_msgf(arena, &result.msgs, E_MsgKind_MalformedInput, token_string.str, "Expected expression following `[`."); + } + else + { + E_Expr *type = e_push_expr(arena, E_ExprKind_TypeIdent, token_string.str); + type->type_key = e_type_key_cons_ptr(e_type_key_basic(E_TypeKind_U64)); + E_Expr *casted = atom; + E_Expr *cast = e_push_expr(arena, E_ExprKind_Cast, token_string.str); + e_expr_push_child(cast, type); + e_expr_push_child(cast, casted); + atom = e_push_expr(arena, E_ExprKind_Deref, token_string.str); + e_expr_push_child(atom, cast); + } // rjf: expect ] E_Token close_paren_maybe = e_token_at_it(it, tokens); @@ -1814,7 +1821,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to } //- rjf: upgrade atom w/ previously parsed prefix unaries - if(atom == &e_expr_nil && first_prefix_unary != 0 && first_prefix_unary->cast_expr != 0) + if(atom == &e_expr_nil && first_prefix_unary != 0 && first_prefix_unary->cast_expr != &e_expr_nil) { atom = first_prefix_unary->cast_expr; for(PrefixUnaryNode *prefix_unary = first_prefix_unary->next; @@ -1830,7 +1837,7 @@ e_parse_expr_from_text_tokens__prec(Arena *arena, String8 text, E_TokenArray *to e_expr_push_child(atom, rhs); } } - else if(atom == 0 && first_prefix_unary != 0) + else if(atom == &e_expr_nil && first_prefix_unary != 0) { e_msgf(arena, &result.msgs, E_MsgKind_MalformedInput, last_prefix_unary->location, "Missing expression."); } diff --git a/src/eval/generated/eval.meta.c b/src/eval/generated/eval.meta.c index 1729ba84..c2198519 100644 --- a/src/eval/generated/eval.meta.c +++ b/src/eval/generated/eval.meta.c @@ -84,8 +84,8 @@ E_OpInfo e_expr_kind_op_info_table[43] = { E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp("."), str8_lit_comp("MemberAccess") }, { E_OpKind_UnaryPrefix, 2, str8_lit_comp("*"), str8_lit_comp(""), str8_lit_comp("Deref") }, { E_OpKind_UnaryPrefix, 2, str8_lit_comp("&"), str8_lit_comp(""), str8_lit_comp("Address") }, -{ E_OpKind_Null, 0, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("Cast") }, -{ E_OpKind_UnaryPrefix, 0, str8_lit_comp("sizeof"), str8_lit_comp(""), str8_lit_comp("Sizeof") }, +{ E_OpKind_Null, 1, str8_lit_comp(""), str8_lit_comp(""), str8_lit_comp("Cast") }, +{ E_OpKind_UnaryPrefix, 1, str8_lit_comp("sizeof"), str8_lit_comp(""), str8_lit_comp("Sizeof") }, { E_OpKind_UnaryPrefix, 2, str8_lit_comp("-"), str8_lit_comp(""), str8_lit_comp("Neg") }, { E_OpKind_UnaryPrefix, 2, str8_lit_comp("!"), str8_lit_comp(""), str8_lit_comp("LogNot") }, { E_OpKind_UnaryPrefix, 2, str8_lit_comp("~"), str8_lit_comp(""), str8_lit_comp("BitNot") },