summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-15 08:54:24 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-15 08:54:24 +0000
commit6bdd198937b62fa2544e6d182876a783ef20ce31 (patch)
tree5a8e3938aff443cdc6e888738cff8d3eecca0886
parent84cf66cc6e40e5154d93b8261aecf7581e5075a0 (diff)
parse.y: Removes unneeded NULL checks
Nowadays, there are less rules whose return value is NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--parse.y12
1 files changed, 1 insertions, 11 deletions
diff --git a/parse.y b/parse.y
index 38c4bdc598..c261cce71b 100644
--- a/parse.y
+++ b/parse.y
@@ -1068,13 +1068,7 @@ bodystmt : compstmt
$$ = block_append(p, $$, $3);
}
if ($4) {
- if ($$) {
- $$ = NEW_ENSURE($$, $4, &@$);
- }
- else {
- NODE *nil = NEW_NIL(&@$);
- $$ = block_append(p, $4, nil);
- }
+ $$ = NEW_ENSURE($$, $4, &@$);
}
fixpos($$, $1);
/*%
@@ -1375,7 +1369,6 @@ expr_value : expr
/*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL(&@$);
/*%
$$ = $1;
%*/
@@ -2107,7 +2100,6 @@ arg_value : arg
/*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL(&@$);
/*%
$$ = $1;
%*/
@@ -2800,7 +2792,6 @@ primary_value : primary
/*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL(&@$);
/*%
$$ = $1;
%*/
@@ -4524,7 +4515,6 @@ singleton : var_ref
/*%%%*/
value_expr($1);
$$ = $1;
- if (!$$) $$ = NEW_NIL(&@$);
/*%
$$ = $1;
%*/