[前][次][番号順一覧][スレッド一覧]

ruby-changes:56415

From: Nobuyoshi <ko1@a...>
Date: Thu, 11 Jul 2019 14:52:35 +0900 (JST)
Subject: [ruby-changes:56415] Nobuyoshi Nakada: 4e038a7e64 (master): Revert "parse.y: Deprecate flip-flops"

https://git.ruby-lang.org/ruby.git/commit/?id=4e038a7e64

From 4e038a7e64a9d52eed59b8f05647d4e58d265ec3 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 11 Jul 2019 14:29:35 +0900
Subject: Revert "parse.y: Deprecate flip-flops"

This reverts commit bae638ad5b782c44c80efe33834cb9039279af46.

[Feature #5400]

diff --git a/parse.y b/parse.y
index e75c0b4..7445e4a 100644
--- a/parse.y
+++ b/parse.y
@@ -10930,10 +10930,8 @@ cond0(struct parser_params *p, NODE *node, int method_op, const YYLTYPE *loc) https://github.com/ruby/ruby/blob/trunk/parse.y#L10930
       case NODE_DOT3:
 	node->nd_beg = range_op(p, node->nd_beg, loc);
 	node->nd_end = range_op(p, node->nd_end, loc);
-	if (nd_type(node) == NODE_DOT2 || nd_type(node) == NODE_DOT3) {
-	    nd_set_type(node, nd_type(node) == NODE_DOT2 ? NODE_FLIP2 : NODE_FLIP3);
-	    parser_warn(p, node, "flip-flop is deprecated");
-	}
+	if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
+	else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
 	if (!method_op && !e_option_supplied(p)) {
 	    int b = literal_node(node->nd_beg);
 	    int e = literal_node(node->nd_end);
diff --git a/spec/ruby/language/if_spec.rb b/spec/ruby/language/if_spec.rb
index 4d80901..e2201f4 100644
--- a/spec/ruby/language/if_spec.rb
+++ b/spec/ruby/language/if_spec.rb
@@ -308,18 +308,6 @@ describe "The if expression" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/language/if_spec.rb#L308
       6.times(&b)
       ScratchPad.recorded.should == [4, 5, 4, 5]
     end
-
-    ruby_version_is "2.6" do
-      it 'is deprecated' do
-        i = 4
-
-        -> do
-          eval "ScratchPad << 'it works' if (i == 4)..(i == 7)"
-        end.should complain(/flip-flop is deprecated/)
-
-        ScratchPad.recorded.should == ['it works']
-      end
-    end
   end
 end
 
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 18546ef..c5c3737 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -1027,9 +1027,7 @@ eom https://github.com/ruby/ruby/blob/trunk/test/ruby/test_syntax.rb#L1027
       eval('1 if !//')
     end
     assert_warn('') do
-      verbose_bak, $VERBOSE = $VERBOSE, nil
       eval('1 if !(true..false)')
-      $VERBOSE = verbose_bak
     end
     assert_warning('') do
       eval('1 if !1')
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]