aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-12 04:50:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-12 04:50:48 +0000
commit2593606c81e5f770701f18c1a280898039b76add (patch)
tree0e137b501bb34e2708e6dbc8012c8fddf9c7014d /compile.c
parent6c4157236206b19dabfd5b8342c23c4864e1fa4e (diff)
downloadruby-2593606c81e5f770701f18c1a280898039b76add.tar.gz
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 244ab18d2c..f5448fa267 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);