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

ruby-changes:19164

From: yugui <ko1@a...>
Date: Mon, 28 Mar 2011 22:45:39 +0900 (JST)
Subject: [ruby-changes:19164] Ruby:r31203 (ruby_1_9_2): merges r30763 from trunk into ruby_1_9_2.

yugui	2011-03-28 22:40:59 +0900 (Mon, 28 Mar 2011)

  New Revision: 31203

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

  Log:
    merges r30763 from trunk into ruby_1_9_2.
    --
    * ext/psych/lib/psych/visitors/to_ruby.rb: ARG_ENCODING_NONE regular
      expressions can round trip. [ruby-core:34969]
    * test/psych/test_yaml.rb: test for ARG_ENCODING_NONE regex
    * ext/sych/lib/syck/rubytypes.rb: ARG_ENCODING_NONE regular
      expressions can round trip.
    * test/syck/test_yaml.rb: test for ARG_ENCODING_NONE regex

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/ext/psych/lib/psych/visitors/to_ruby.rb
    branches/ruby_1_9_2/ext/syck/lib/syck/rubytypes.rb
    branches/ruby_1_9_2/test/psych/test_yaml.rb
    branches/ruby_1_9_2/test/syck/test_yaml.rb
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 31202)
+++ ruby_1_9_2/ChangeLog	(revision 31203)
@@ -1,3 +1,15 @@
+Thu Feb  3 07:02:16 2011  Aaron Patterson <aaron@t...>
+
+	* ext/psych/lib/psych/visitors/to_ruby.rb: ARG_ENCODING_NONE regular
+	  expressions can round trip. [ruby-core:34969]
+
+	* test/psych/test_yaml.rb: test for ARG_ENCODING_NONE regex
+
+	* ext/sych/lib/syck/rubytypes.rb: ARG_ENCODING_NONE regular
+	  expressions can round trip.
+
+	* test/syck/test_yaml.rb: test for ARG_ENCODING_NONE regex
+
 Mon Jan 31 21:32:44 2011  CHIKANAGA Tomoyuki  <nagachika00@g...>
 
 	* thread.c (thread_start_func_2): check deadlock condition before
Index: ruby_1_9_2/ext/psych/lib/psych/visitors/to_ruby.rb
===================================================================
--- ruby_1_9_2/ext/psych/lib/psych/visitors/to_ruby.rb	(revision 31202)
+++ ruby_1_9_2/ext/psych/lib/psych/visitors/to_ruby.rb	(revision 31203)
@@ -60,7 +60,7 @@
         when "tag:yaml.org,2002:float", "!float"
           Float(@ss.tokenize(o.value))
         when "!ruby/regexp"
-          o.value =~ /^\/(.*)\/([mix]*)$/
+          o.value =~ /^\/(.*)\/([mixn]*)$/
           source  = $1
           options = 0
           lang    = nil
@@ -69,6 +69,9 @@
             when 'x' then options |= Regexp::EXTENDED
             when 'i' then options |= Regexp::IGNORECASE
             when 'm' then options |= Regexp::MULTILINE
+
+            # FIXME: there is no constant for ARG_ENCODING_NONE
+            when 'n' then options |= 32
             else lang = option
             end
           end
Index: ruby_1_9_2/ext/syck/lib/syck/rubytypes.rb
===================================================================
--- ruby_1_9_2/ext/syck/lib/syck/rubytypes.rb	(revision 31202)
+++ ruby_1_9_2/ext/syck/lib/syck/rubytypes.rb	(revision 31203)
@@ -261,7 +261,7 @@
 class Regexp
     yaml_as "tag:ruby.yaml.org,2002:regexp"
     def Regexp.yaml_new( klass, tag, val )
-        if String === val and val =~ /^\/(.*)\/([mix]*)$/
+        if String === val and val =~ /^\/(.*)\/([mixn]*)$/
             val = { 'regexp' => $1, 'mods' => $2 }
         end
         if Hash === val
@@ -271,6 +271,7 @@
                 mods |= Regexp::EXTENDED if val['mods'].include?( 'x' )
                 mods |= Regexp::IGNORECASE if val['mods'].include?( 'i' )
                 mods |= Regexp::MULTILINE if val['mods'].include?( 'm' )
+                mods |= 32 if val['mods'].include?( 'n' )
             end
             val.delete( 'mods' )
             r = YAML::object_maker( klass, {} )
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 31202)
+++ ruby_1_9_2/version.h	(revision 31203)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 186
+#define RUBY_PATCHLEVEL 187
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_2/test/psych/test_yaml.rb
===================================================================
--- ruby_1_9_2/test/psych/test_yaml.rb	(revision 31202)
+++ ruby_1_9_2/test/psych/test_yaml.rb	(revision 31203)
@@ -13,6 +13,11 @@
     def teardown
         Psych.domain_types.clear
     end
+
+    # [ruby-core:34969]
+    def test_regexp_with_n
+        assert_cycle(Regexp.new('',0,'n'))
+    end
 	#
 	# Tests modified from 00basic.t in Psych.pm
 	#
Index: ruby_1_9_2/test/syck/test_yaml.rb
===================================================================
--- ruby_1_9_2/test/syck/test_yaml.rb	(revision 31202)
+++ ruby_1_9_2/test/syck/test_yaml.rb	(revision 31203)
@@ -22,6 +22,11 @@
         YAML::ENGINE.yamler = @current_engine
     end
 
+    # [ruby-core:34969]
+    def test_regexp_with_n
+        assert_cycle(Regexp.new('',0,'n'))
+    end
+
 	#
 	# Convert between YAML and the object to verify correct parsing and
 	# emitting

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

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