diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-05-12 11:34:01 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-05-21 13:52:29 +0900 |
| commit | ee8bbbabe549d1ff8a37509e3a5dc9e648aced3a (patch) | |
| tree | 23bed19104391e195b5600e8631540e8c40648e8 /parse.y | |
| parent | 2e765c20dbd542d43155749910421b0f7963524f (diff) | |
ripper: Show popped TOS in debug mode
Diffstat (limited to 'parse.y')
| -rw-r--r-- | parse.y | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -634,10 +634,10 @@ static void after_reduce(int len, struct parser_params *p) { for (int i = 0; i < len; i++) { + VALUE tos = rb_ary_pop(p->s_value_stack); if (p->debug) { - rb_parser_printf(p, "after-reduce pop: %+"PRIsVALUE"\n", rb_ary_entry(p->s_value_stack, -1)); + rb_parser_printf(p, "after-reduce pop: %+"PRIsVALUE"\n", tos); } - rb_ary_pop(p->s_value_stack); } if (p->debug) { rb_parser_printf(p, "after-reduce push: %+"PRIsVALUE"\n", p->s_lvalue); @@ -659,10 +659,10 @@ static void after_pop_stack(int len, struct parser_params *p) { for (int i = 0; i < len; i++) { + VALUE tos = rb_ary_pop(p->s_value_stack); if (p->debug) { - rb_parser_printf(p, "after-pop-stack pop: %+"PRIsVALUE"\n", rb_ary_entry(p->s_value_stack, -1)); + rb_parser_printf(p, "after-pop-stack pop: %+"PRIsVALUE"\n", tos); } - rb_ary_pop(p->s_value_stack); } } #else |
