diff options
author | eileencodes <[email protected]> | 2024-08-20 13:34:08 -0400 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2024-08-21 11:37:13 -0400 |
commit | 7ad74d1686b626b72228e3d24d5448adcfe23d48 () | |
tree | e7b2137f6d94a093bcd110a0a8f0580e2f3f1a93 /prism_compile.c | |
parent | e15b454bc3da5280923325df660f9b05fa34061c (diff) |
[PRISM] Implement unused block warning
Related: ruby/prism#2935
Notes: Merged: https://.com/ruby/ruby/pull/11415
-rw-r--r-- | prism_compile.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -3825,6 +3825,7 @@ pm_compile_defined_expr0(rb_iseq_t *iseq, const pm_node_t *node, const pm_node_l case PM_YIELD_NODE: PUSH_INSN(ret, location, putnil); PUSH_INSN3(ret, location, defined, INT2FIX(DEFINED_YIELD), 0, PUSH_VAL(DEFINED_YIELD)); return; case PM_SUPER_NODE: case PM_FORWARDING_SUPER_NODE: @@ -6962,6 +6963,9 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, PUSH_LABEL(ret, retry_label); } PUSH_INSN(ret, location, putself); int flag = VM_CALL_ZSUPER | VM_CALL_SUPER | VM_CALL_FCALL; @@ -8994,6 +8998,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, if (parameters_node->block) { body->param.block_start = local_index; body->param.flags.has_block = true; pm_constant_id_t name = ((const pm_block_parameter_node_t *) parameters_node->block)->name; @@ -9549,6 +9554,10 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, pm_scope_node_destroy(&next_scope_node); } if ((flags & VM_CALL_ARGS_BLOCKARG) && (flags & VM_CALL_KW_SPLAT) && !(flags & VM_CALL_KW_SPLAT_MUT)) { PUSH_INSN(args, location, splatkw); } @@ -9681,6 +9690,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, } PUSH_INSN1(ret, location, invokeblock, new_callinfo(iseq, 0, argc, flags, keywords, FALSE)); if (popped) PUSH_INSN(ret, location, pop); int level = 0; |