diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-24 08:00:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-24 08:00:36 +0000 |
commit | 2c786bf35d62aa084bcb3915b0a10f2d4840459f (patch) | |
tree | 784c12f649b1e56aba2f399210414fd74ef894f1 /compile.c | |
parent | 30f5c55890bc9f1db68b7b709ed04b5b10ec9946 (diff) | |
download | ruby-2c786bf35d62aa084bcb3915b0a10f2d4840459f.tar.gz |
Removed NODE_OPT_N
* node.h (NODE_OPT_N): removed.
* parse.y (parser_append_options): expand -n option loop to while
gets loop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -4517,7 +4517,7 @@ compile_loop(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popped, co ISEQ_COMPILE_DATA(iseq)->loopval_popped = 0; push_ensure_entry(iseq, &enl, NULL, NULL); - if (type == NODE_OPT_N || node->nd_state == 1) { + if (node->nd_state == 1) { ADD_INSNL(ret, line, jump, next_label); } else { @@ -4541,17 +4541,11 @@ compile_loop(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popped, co compile_branch_condition(iseq, ret, node->nd_cond, redo_label, end_label); } - else if (type == NODE_UNTIL) { + else { /* until */ compile_branch_condition(iseq, ret, node->nd_cond, end_label, redo_label); } - else { - ADD_CALL_RECEIVER(ret, line); - ADD_CALL(ret, line, idGets, INT2FIX(0)); - ADD_INSNL(ret, line, branchif, redo_label); - /* opt_n */ - } ADD_LABEL(ret, end_label); ADD_ADJUST_RESTORE(ret, adjust_label); @@ -5103,7 +5097,6 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, NODE *node, int popp case NODE_WHEN: CHECK(compile_when(iseq, ret, node, popped)); break; - case NODE_OPT_N: case NODE_WHILE: case NODE_UNTIL: CHECK(compile_loop(iseq, ret, node, popped, type)); |