summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-12 04:50:48 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-12 04:50:48 (GMT)
commitfe781af37755a206f17676163fda6e3707ef7623 (patch)
tree0e137b501bb34e2708e6dbc8012c8fddf9c7014d /compile.c
parente7f88ff68438bf1bc490515a41ea4f1f1a7f4769 (diff)
compile.c: use EXPECT_NODE macro
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/compile.c b/compile.c
index 244ab18..f5448fa 100644
--- a/compile.c
+++ b/compile.c
@@ -4955,6 +4955,7 @@ compile_case(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_nod
DECL_BRANCH_BASE(branches, nd_first_lineno(node), nd_first_column(node), nd_last_lineno(node), nd_last_column(node), "case");
node = node->nd_body;
+ EXPECT_NODE("NODE_CASE", node, NODE_WHEN, COMPILE_NG);
type = nd_type(node);
line = nd_line(node);
lineno = nd_first_lineno(node);
@@ -4962,11 +4963,6 @@ compile_case(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *const orig_nod
last_lineno = nd_last_lineno(node);
last_column = nd_last_column(node);
- if (type != NODE_WHEN) {
- COMPILE_ERROR(ERROR_ARGS "NODE_CASE: unexpected node. must be NODE_WHEN, but %s", ruby_node_name(type));
- return COMPILE_NG;
- }
-
endlabel = NEW_LABEL(line);
elselabel = NEW_LABEL(line);