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

ruby-changes:54655

From: naruse <ko1@a...>
Date: Sat, 19 Jan 2019 16:49:52 +0900 (JST)
Subject: [ruby-changes:54655] naruse:r66871 (trunk): Indented here document (<<~) is Ruby 2.3 feature

naruse	2019-01-19 16:49:47 +0900 (Sat, 19 Jan 2019)

  New Revision: 66871

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66871

  Log:
    Indented here document (<<~) is Ruby 2.3 feature

  Modified files:
    trunk/bootstraptest/test_insns.rb
Index: bootstraptest/test_insns.rb
===================================================================
--- bootstraptest/test_insns.rb	(revision 66870)
+++ bootstraptest/test_insns.rb	(revision 66871)
@@ -28,20 +28,20 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L28
   [ 'getlocal *, 1', %q{ x = true; -> { x }.call }, ],
   [ 'getlocal',      %q{ x = true; -> { -> { x }.() }.() }, ],
 
-  [ 'setblockparam', <<~'},', ], # {
+  [ 'setblockparam', <<-'},', ], # {
     def m&b
       b = # here
         proc { true }
     end
     m { false }.call
   },
-  [ 'getblockparam', <<~'},', ], # {
+  [ 'getblockparam', <<-'},', ], # {
     def m&b
       b # here
     end
     m { true }.call
   },
-  [ 'getblockparamproxy', <<~'},', ], # {
+  [ 'getblockparamproxy', <<-'},', ], # {
     def m&b
       b # here
         .call
@@ -101,11 +101,11 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L101
   [ 'expandarray', %q{ y = [ true, false, nil ]; x, *z, w = y; x }, ],
   [ 'splatarray',  %q{ x, = *(y = true), false; x }, ],
   [ 'concatarray', %q{ ["t", "r", *x = "u", "e"].join }, ],
-  [ 'concatarray', <<~'},', ],  # {
+  [ 'concatarray', <<-'},', ],  # {
     class X; def to_a; ['u']; end; end
     ['t', 'r', *X.new, 'e'].join
   },
-  [ 'concatarray', <<~'},', ],  # {
+  [ 'concatarray', <<-'},', ],  # {
     r = false
     t = [true, nil]
     q, w, e = r, *t             # here
@@ -122,7 +122,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L122
   [ 'dup',     %q{ x = y = true; x }, ],
   [ 'dupn',    %q{ Object::X ||= true }, ],
   [ 'reverse', %q{ q, (w, e), r = 1, [2, 3], 4; e == 3 }, ],
-  [ 'swap',    <<~'},', ],      # {
+  [ 'swap',    <<-'},', ],      # {
     x = [[false, true]]
     for i, j in x               # here
       ;
@@ -137,7 +137,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L137
   [ 'defined',      %q{ !defined?(x) }, ],
   [ 'checkkeyword', %q{ def x x:rand;x end; x x: true }, ],
   [ 'checktype',    %q{ x = true; "#{x}" }, ],
-  [ 'checkmatch',   <<~'},', ], # {
+  [ 'checkmatch',   <<-'},', ], # {
     x = y = true
     case x
     when false
@@ -147,7 +147,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L147
     end
     y == nil
   },
-  [ 'checkmatch',   <<~'},', ], # {
+  [ 'checkmatch',   <<-'},', ], # {
     x, y = true, [false]
     case x
     when *y                     # here
@@ -157,7 +157,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L157
     end
     z
   },
-  [ 'checkmatch',   <<~'},', ], # {
+  [ 'checkmatch',   <<-'},', ], # {
     x = false
     begin
       raise
@@ -173,7 +173,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L173
   [ 'defineclass', %q{ X = Class.new;  class X;     true end }, ],
   [ 'defineclass', %q{ X = Class.new;  class Y < X; true end }, ],
   [ 'defineclass', %q{ X = Class.new;  class << X;  true end }, ],
-  [ 'defineclass', <<~'},', ], # {
+  [ 'defineclass', <<-'},', ], # {
     X = Class.new
     Y = Class.new(X)
     class Y < X
@@ -184,7 +184,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L184
   [ 'opt_send_without_block', %q{ true.to_s }, ],
   [ 'send',                   %q{ true.tap {|i| i.to_s } }, ],
   [ 'leave',                  %q{ def x; true; end; x }, ],
-  [ 'invokesuper',            <<~'},', ], # {
+  [ 'invokesuper',            <<-'},', ], # {
     class X < String
       def empty?
         super                   # here
@@ -192,7 +192,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L192
     end
    X.new.empty?
   },
-  [ 'invokeblock',            <<~'},', ], # {
+  [ 'invokeblock',            <<-'},', ], # {
     def x
       return yield self         # here
     end
@@ -203,7 +203,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L203
 
   [ 'opt_str_freeze', %q{ 'true'.freeze }, ],
   [ 'opt_str_uminus', %q{ -'true' }, ],
-  [ 'opt_str_freeze', <<~'},', ], # {
+  [ 'opt_str_freeze', <<-'},', ], # {
     class String
       def freeze
         true
@@ -214,7 +214,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L214
 
   [ 'opt_newarray_max', %q{ [ ].max.nil? }, ],
   [ 'opt_newarray_max', %q{ [1, x = 2, 3].max == 3 }, ],
-  [ 'opt_newarray_max', <<~'},', ], # {
+  [ 'opt_newarray_max', <<-'},', ], # {
     class Array
       def max
         true
@@ -224,7 +224,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L224
   },
   [ 'opt_newarray_min', %q{ [ ].min.nil? }, ],
   [ 'opt_newarray_min', %q{ [3, x = 2, 1].min == 1 }, ],
-  [ 'opt_newarray_min', <<~'},', ], # {
+  [ 'opt_newarray_min', <<-'},', ], # {
     class Array
       def min
         true
@@ -240,12 +240,12 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L240
   [ 'branchunless', %q{ x = nil;  x &&= true; x.nil? }, ],
   [ 'branchnil',    %q{ x = true; x&.to_s }, ],
   [ 'branchnil',    %q{ x = nil;  (x&.to_s).nil? }, ],
-  [ 'jump',         <<~'},', ], # {
+  [ 'jump',         <<-'},', ], # {
     y = 1
     x = if y == 0 then nil elsif y == 1 then true else nil end
     x
   },
-  [ 'jump',         <<~'},', ], # {
+  [ 'jump',         <<-'},', ], # {
     # ultra complicated situation: this ||= assignment only generates
     # 15 instructions, not including the class definition.
     class X; attr_accessor :x; end
@@ -254,14 +254,14 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L254
   },
 
   [ 'once', %q{ /#{true}/o =~ "true" && $~ }, ],
-  [ 'once', <<~'},', ],         # {
+  [ 'once', <<-'},', ],         # {
     def once expr
       return /#{expr}/o         # here
     end
     x = once(true); x = once(false); x = once(nil);
     x =~ "true" && $~
   },
-  [ 'once', <<~'},', ],         # {
+  [ 'once', <<-'},', ],         # {
     # recursive once
     def once n
       return %r/#{
@@ -275,7 +275,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L275
     x = once(128); x = once(7); x = once(16);
     x =~ "true" && $~
   },
-  [ 'once', <<~'},', ],         # {
+  [ 'once', <<-'},', ],         # {
     # inter-thread lockup situation
     def once n
       return Thread.start n do |m|
@@ -323,12 +323,12 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L323
   [ 'opt_mod',     %q{ '%s' % [ true ] }, ],
 
   [ 'opt_eq', %q{ 1 == 1 }, ],
-  [ 'opt_eq', <<~'},', ],       # {
+  [ 'opt_eq', <<-'},', ],       # {
     class X; def == other; true; end; end
     X.new == true
   },
   [ 'opt_neq', %q{ 1 != 0 }, ],
-  [ 'opt_neq', <<~'},', ],       # {
+  [ 'opt_neq', <<-'},', ],       # {
     class X; def != other; true; end; end
     X.new != true
   },
@@ -360,7 +360,7 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L360
   [ 'opt_aset', %q{ [][0] = true }, ],
   [ 'opt_aset', %q{ {}[0] = true }, ],
   [ 'opt_aset', %q{ x = 'frue'; x[0] = 't'; x }, ],
-  [ 'opt_aset', <<~'},', ], # {
+  [ 'opt_aset', <<-'},', ], # {
     # opt_aref / opt_aset mixup situation
     class X; def x; {}; end; end
     x = X.new
@@ -393,18 +393,18 @@ tests = [ https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_insns.rb#L393
   [ 'opt_succ',  %q{ x = Time.at(0); x.succ == Time.at(1) }, ],
 
   [ 'opt_not',  %q{ ! false }, ],
-  [ 'opt_neq', <<~'},', ],       # {
+  [ 'opt_neq', <<-'},', ],       # {
     class X; def !; true; end; end
     ! X.new
   },
 
   [ 'opt_regexpmatch1',  %q{ /true/ =~ 'true' && $~ }, ],
-  [ 'opt_regexpmatch1', <<~'},', ],       # {
+  [ 'opt_regexpmatch1', <<-'},', ],       # {
     class Regexp; def =~ other; true; end; end
     /true/ =~ 'true'
   },
   [ 'opt_regexpmatch2',  %q{ 'true' =~ /true/ && $~ }, ],
-  [ 'opt_regexpmatch2', <<~'},', ],       # {
+  [ 'opt_regexpmatch2', <<-'},', ],       # {
     class String; def =~ other; true; end; end
     'true' =~ /true/
   },

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

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