From cc6b1b3c8d4f7d617c0870c05c501903fc7fd00b Mon Sep 17 00:00:00 2001 From: tenderlove Date: Wed, 2 Feb 2011 22:05:15 +0000 Subject: * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/syck/lib/syck/rubytypes.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext/syck/lib/syck') diff --git a/ext/syck/lib/syck/rubytypes.rb b/ext/syck/lib/syck/rubytypes.rb index f8bbfea022..883c8d5bfc 100644 --- a/ext/syck/lib/syck/rubytypes.rb +++ b/ext/syck/lib/syck/rubytypes.rb @@ -261,7 +261,7 @@ end 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 @@ class Regexp 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, {} ) -- cgit v1.2.3