mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/psych/lib/psych/visitors/to_ruby.rb: fix support for regular
expressions with newlines. tenderlove/psych#222 * test/psych/test_yaml.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4194ca02fb
commit
56d4257a67
3 changed files with 13 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
Fri Feb 6 16:58:31 2015 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||
|
||||
* ext/psych/lib/psych/visitors/to_ruby.rb: fix support for regular
|
||||
expressions with newlines. tenderlove/psych#222
|
||||
|
||||
* test/psych/test_yaml.rb: test for change.
|
||||
|
||||
Fri Feb 6 10:31:50 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* vm_core.h (rb_call_info_kw_arg_struct): make keywords a symbols
|
||||
|
|
|
@ -32,7 +32,7 @@ module Psych
|
|||
return result if @domain_types.empty? || !target.tag
|
||||
|
||||
key = target.tag.sub(/^[!\/]*/, '').sub(/(,\d+)\//, '\1:')
|
||||
key = "tag:#{key}" unless key =~ /^(tag:|x-private)/
|
||||
key = "tag:#{key}" unless key =~ /^(?:tag:|x-private)/
|
||||
|
||||
if @domain_types.key? key
|
||||
value, block = @domain_types[key]
|
||||
|
@ -89,7 +89,7 @@ module Psych
|
|||
Float(@ss.tokenize(o.value))
|
||||
when "!ruby/regexp"
|
||||
klass = class_loader.regexp
|
||||
o.value =~ /^\/(.*)\/([mixn]*)$/
|
||||
o.value =~ /^\/(.*)\/([mixn]*)$/m
|
||||
source = $1
|
||||
options = 0
|
||||
lang = nil
|
||||
|
|
|
@ -27,6 +27,10 @@ class Psych_Unit_Tests < Psych::TestCase
|
|||
assert_match "2010-10-10 00:00:00.000000000 Z", yaml
|
||||
end
|
||||
|
||||
def test_multiline_regexp
|
||||
assert_cycle(Regexp.new("foo\nbar"))
|
||||
end
|
||||
|
||||
# [ruby-core:34969]
|
||||
def test_regexp_with_n
|
||||
assert_cycle(Regexp.new('',0,'n'))
|
||||
|
|
Loading…
Add table
Reference in a new issue