summaryrefslogtreecommitdiff
path: root/node.c
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.c
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.c')
-rw-r--r--node.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/node.c b/node.c
index 0222a19af1..a0544d7a7a 100644
--- a/node.c
+++ b/node.c
@@ -200,6 +200,16 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
F_NODE(nd_else, "else clause");
break;
+ case NODE_UNLESS:
+ ANN("unless statement");
+ ANN("format: unless [nd_cond] then [nd_body] else [nd_else] end");
+ ANN("example: unless x == 1 then foo else bar end");
+ F_NODE(nd_cond, "condition expr");
+ F_NODE(nd_body, "then clause");
+ LAST_NODE;
+ F_NODE(nd_else, "else clause");
+ break;
+
case NODE_CASE:
ANN("case statement");
ANN("format: case [nd_head]; [nd_body]; end");