summaryrefslogtreecommitdiff
path: root/node.h
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-14 05:27:02 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-14 05:27:02 +0000
commit3c8c17d30defb41399eed65f2cf0f30e5469fa07 (patch)
tree787002814cee9110d387332bca69770f62394e40 /node.h
parent78cf46078e8de57c84807111938173afcb4bcf73 (diff)
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
Diffstat (limited to 'node.h')
-rw-r--r--node.h4
1 files changed, 3 insertions, 1 deletions
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)