mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
compile.c: use EXPECT_NODE macro
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e7f88ff684
commit
fe781af377
1 changed files with 1 additions and 5 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue