summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-29 13:22:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-29 13:22:39 +0000
commit082445e7aff1fb6f04cf2c17b3c2582e64e096d3 (patch)
tree0111263ae80aae2f1171d015465cdface1992a4d
parent9a39740ef3f5009a99a511591b28c190f9d58760 (diff)
parse.y: condition node
* parse.y (logop_gen): keep non-null condition node. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--bootstraptest/test_syntax.rb2
-rw-r--r--parse.y1
2 files changed, 2 insertions, 1 deletions
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index 80eaa64..a111990 100644
--- a/bootstraptest/test_syntax.rb
+++ b/bootstraptest/test_syntax.rb
@@ -376,6 +376,8 @@ assert_equal %q{1}, %q{1 or 2 or 3 or 4}
assert_equal %q{1}, %q{1 or false or 3 or 4}
assert_equal %q{2}, %q{nil or 2 or 3 or 4}
assert_equal %q{2}, %q{false or 2 or 3 or 4}
+assert_equal %q{1}, %q{if true && ""; then 1; end}
+assert_equal %q{1}, %q{if nil || true; then 1; end}
assert_equal %q{false}, %q{nil or false or nil or false}
assert_equal %q{elseng}, %q{
case
diff --git a/parse.y b/parse.y
index b48d910..41f2621 100644
--- a/parse.y
+++ b/parse.y
@@ -9694,7 +9694,6 @@ logop_gen(struct parser_params *parser, enum node_type type, NODE *left, NODE *r
case NODE_NIL:
case NODE_FALSE:
if (type == NODE_AND) return left;
- left = 0;
break;
case NODE_TRUE:
case NODE_LIT: