[前][次][番号順一覧][スレッド一覧]

ruby-changes:52108

From: nobu <ko1@a...>
Date: Sun, 12 Aug 2018 13:50:53 +0900 (JST)
Subject: [ruby-changes:52108] nobu:r64316 (trunk): compile.c: use EXPECT_NODE macro

nobu	2018-08-12 13:50:48 +0900 (Sun, 12 Aug 2018)

  New Revision: 64316

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64316

  Log:
    compile.c: use EXPECT_NODE macro

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 64315)
+++ compile.c	(revision 64316)
@@ -4955,6 +4955,7 @@ compile_case(rb_iseq_t *iseq, LINK_ANCHO https://github.com/ruby/ruby/blob/trunk/compile.c#L4955
     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_ANCHO https://github.com/ruby/ruby/blob/trunk/compile.c#L4963
     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);
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]