diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-14 05:27:02 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-14 05:27:02 +0000 |
commit | 3c8c17d30defb41399eed65f2cf0f30e5469fa07 (patch) | |
tree | 787002814cee9110d387332bca69770f62394e40 /node.c | |
parent | 78cf46078e8de57c84807111938173afcb4bcf73 (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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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"); |