From 3c8c17d30defb41399eed65f2cf0f30e5469fa07 Mon Sep 17 00:00:00 2001 From: mame Date: Thu, 14 Sep 2017 05:27:02 +0000 Subject: Introduce NODE_UNLESS for branch coverage `unless` statement was a syntactic sugar for `if` statement, which made the result of branch coverage hard to understand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- node.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'node.h') diff --git a/node.h b/node.h index 5590369e2e..b9db99291b 100644 --- a/node.h +++ b/node.h @@ -26,6 +26,8 @@ enum node_type { #define NODE_BLOCK NODE_BLOCK NODE_IF, #define NODE_IF NODE_IF + NODE_UNLESS, +#define NODE_UNLESS NODE_UNLESS NODE_CASE, #define NODE_CASE NODE_CASE NODE_WHEN, @@ -362,7 +364,7 @@ typedef struct RNode { #define NEW_SCOPE(a,b) NEW_NODE(NODE_SCOPE,local_tbl(),b,a) #define NEW_BLOCK(a) NEW_NODE(NODE_BLOCK,a,0,0) #define NEW_IF(c,t,e) NEW_NODE(NODE_IF,c,t,e) -#define NEW_UNLESS(c,t,e) NEW_IF(c,e,t) +#define NEW_UNLESS(c,t,e) NEW_NODE(NODE_UNLESS,c,t,e) #define NEW_CASE(h,b) NEW_NODE(NODE_CASE,h,b,0) #define NEW_WHEN(c,t,e) NEW_NODE(NODE_WHEN,c,t,e) #define NEW_OPT_N(b) NEW_NODE(NODE_OPT_N,0,b,0) -- cgit v1.2.3