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

ruby-changes:35185

From: nagachika <ko1@a...>
Date: Mon, 25 Aug 2014 00:35:47 +0900 (JST)
Subject: [ruby-changes:35185] nagachika:r47267 (ruby_2_1): merge revision(s) r47090: [Backport #10114]

nagachika	2014-08-25 00:35:33 +0900 (Mon, 25 Aug 2014)

  New Revision: 47267

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

  Log:
    merge revision(s) r47090: [Backport #10114]
    
    * parse.y (parser_yyerror): preserve source code encoding in
      syntax error messages.  [ruby-core:64228] [Bug #10114]

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/parse.y
    branches/ruby_2_1/test/ruby/test_syntax.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 47266)
+++ ruby_2_1/ChangeLog	(revision 47267)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon Aug 25 00:26:12 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (parser_yyerror): preserve source code encoding in
+	  syntax error messages.  [ruby-core:64228] [Bug #10114]
+
 Sat Aug 23 02:39:20 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* vm_insnhelper.c (vm_call_method): unusable super class should cause
Index: ruby_2_1/parse.y
===================================================================
--- ruby_2_1/parse.y	(revision 47266)
+++ ruby_2_1/parse.y	(revision 47267)
@@ -5269,7 +5269,7 @@ parser_yyerror(struct parser_params *par https://github.com/ruby/ruby/blob/trunk/ruby_2_1/parse.y#L5269
 	buf = ALLOCA_N(char, len+2);
 	MEMCPY(buf, p, char, len);
 	buf[len] = '\0';
-	rb_compile_error_append("%s%s%s", pre, buf, post);
+	rb_compile_error_with_enc(NULL, 0, (void *)current_enc, "%s%s%s", pre, buf, post);
 
 	i = (int)(lex_p - p);
 	p2 = buf; pe = buf + len;
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 47266)
+++ ruby_2_1/version.h	(revision 47267)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.2"
-#define RUBY_RELEASE_DATE "2014-08-23"
-#define RUBY_PATCHLEVEL 207
+#define RUBY_RELEASE_DATE "2014-08-25"
+#define RUBY_PATCHLEVEL 208
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 8
-#define RUBY_RELEASE_DAY 23
+#define RUBY_RELEASE_DAY 25
 
 #include "ruby/version.h"
 
Index: ruby_2_1/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_1/test/ruby/test_syntax.rb	(revision 47266)
+++ ruby_2_1/test/ruby/test_syntax.rb	(revision 47267)
@@ -402,6 +402,12 @@ eom https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_syntax.rb#L402
     end
   end
 
+  def test_error_message_encoding
+    bug10114 = '[ruby-core:64228] [Bug #10114]'
+    code = "# -*- coding: utf-8 -*-\n" "def n \"\u{2208}\"; end"
+    assert_syntax_error(code, /def n "\u{2208}"; end/, bug10114)
+  end
+
   private
 
   def not_label(x) @result = x; @not_label ||= nil end

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r47090


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

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