Project

General

Profile

Actions

Bug #6205

closed

YAML Regexp in anchor gets converted to String

Added by giddie (Paul Dann) about 13 years ago. Updated about 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
Backport:
[ruby-core:43681]

Description

I'll try to illustrate with code:

YAML:

hello: &allow-float
!ruby/regexp '/hello/'
bla: *allow-float

RUBY:
require 'yaml'

config = YAML.load_file('config.yaml')
puts config.inspect
puts config['hello'].class
puts config['bla'].class

OUTPUT:
{"hello"=>/hello/, "bla"=>"/hello/"}
Regexp
String

The Regexp has become a string. This only seems to happen if the Regexp is at the root of the anchor.

This happens with Ruby 1.9.3p0, but not with 1.9.2p290.

Updated by tenderlovemaking (Aaron Patterson) about 13 years ago

  • Status changed from Open to Closed
  • Assignee set to tenderlovemaking (Aaron Patterson)
  • % Done changed from 0 to 100

Thanks for the bug report!

This was fixed in r33679. I'll make a request to backport the fix to the 1.9.3 branch.

Actions

Also available in: Atom PDF

Like0
Like0