aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-24 08:00:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-24 08:00:36 +0000
commit07b0b0735fe021dc3fc0b36edbd0f0da32be35bd (patch)
tree784c12f649b1e56aba2f399210414fd74ef894f1 /compile.c
parentaaa9aa9e4bd61b81e4013725f4ba9c1fab333a9c (diff)
downloadruby-07b0b0735fe021dc3fc0b36edbd0f0da32be35bd.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.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/compile.c b/compile.c
index a1887521a0..3d59b6383f 100644
--- a/compile.c
+++ b/compile.c
@@ -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));