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

ruby-changes:42397

From: naruse <ko1@a...>
Date: Sat, 2 Apr 2016 01:11:26 +0900 (JST)
Subject: [ruby-changes:42397] naruse:r54471 (ruby_2_3): merge revision(s) 53722: [Backport #12232]

naruse	2016-04-02 02:08:01 +0900 (Sat, 02 Apr 2016)

  New Revision: 54471

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

  Log:
    merge revision(s) 53722: [Backport #12232]
    
    * ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix
      Ripper.lex error in dedenting squiggly heredoc.  heredoc tree is
      also an array of Elem in the outer tree.  [Fix GH-1234]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/ext/ripper/lib/ripper/lexer.rb
    branches/ruby_2_3/test/ripper/test_scanner_events.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 54470)
+++ ruby_2_3/ChangeLog	(revision 54471)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Sat Apr  2 02:07:29 2016  Seiei Miyagi  <hanachin@g...>
+
+	* ext/ripper/lib/ripper/lexer.rb (on_heredoc_dedent): Fix
+	  Ripper.lex error in dedenting squiggly heredoc.  heredoc tree is
+	  also an array of Elem in the outer tree.  [Fix GH-1234]
+
 Wed Mar 30 02:28:13 2016  Eric Wong  <e@8...>
 
 	* thread_pthread.c (setup_communication_pipe): delay setting owner
Index: ruby_2_3/test/ripper/test_scanner_events.rb
===================================================================
--- ruby_2_3/test/ripper/test_scanner_events.rb	(revision 54470)
+++ ruby_2_3/test/ripper/test_scanner_events.rb	(revision 54471)
@@ -103,6 +103,12 @@ class TestRipper::ScannerEvents < Test:: https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ripper/test_scanner_events.rb#L103
                   [[5, 0], :on_imaginary, "5.6ri"],
                  ],
                  Ripper.lex("1r\n2i\n3ri\n4.2r\n5.6ri")
+     assert_equal [[[1, 0], :on_heredoc_beg, "<<~EOS"],
+                   [[1, 6], :on_nl, "\n"],
+                   [[2, 2], :on_tstring_content, "heredoc\n"],
+                   [[3, 0], :on_heredoc_end, "EOS"]
+                 ],
+                 Ripper.lex("<<~EOS\n  heredoc\nEOS")
   end
 
   def test_location
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 54470)
+++ ruby_2_3/version.h	(revision 54471)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.0"
-#define RUBY_RELEASE_DATE "2016-03-30"
-#define RUBY_PATCHLEVEL 71
+#define RUBY_RELEASE_DATE "2016-04-02"
+#define RUBY_PATCHLEVEL 72
 
 #define RUBY_RELEASE_YEAR 2016
-#define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 30
+#define RUBY_RELEASE_MONTH 4
+#define RUBY_RELEASE_DAY 2
 
 #include "ruby/version.h"
 
Index: ruby_2_3/ext/ripper/lib/ripper/lexer.rb
===================================================================
--- ruby_2_3/ext/ripper/lib/ripper/lexer.rb	(revision 54470)
+++ ruby_2_3/ext/ripper/lib/ripper/lexer.rb	(revision 54471)
@@ -66,7 +66,7 @@ class Ripper https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ext/ripper/lib/ripper/lexer.rb#L66
     private
 
     def on_heredoc_dedent(v, w)
-      @buf.each do |e|
+      @buf.last.each do |e|
         if e.event == :on_tstring_content
           if (n = dedent_string(e.tok, w)) > 0
             e.pos[1] += n

Property changes on: ruby_2_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53722


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

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