summaryrefslogtreecommitdiff
path: root/lib/yaml
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-15 04:38:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-15 04:38:39 +0000
commit79133371e8abb1a7cbdd24b3c62ce04d7227c4b0 (patch)
tree26a8553d874d5eed6566d4a951146c44dd4c67e1 /lib/yaml
parent36de1f6acbb66fba5bbe37fb119530e48060b7d6 (diff)
* ext/syck/MANIFEST, ext/syck/depend: new file.
* lib/yaml/rubytypes.rb: range of exponential floats. [ruby-core:02824] * test/yaml/test_yaml.rb: tests for strings start with colon and some round trip. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml')
-rw-r--r--lib/yaml/rubytypes.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
index 1f7f49633c..239688a6b2 100644
--- a/lib/yaml/rubytypes.rb
+++ b/lib/yaml/rubytypes.rb
@@ -371,7 +371,7 @@ end
symbol_proc = Proc.new { |type, val|
if String === val
- val = YAML::load( "--- #{val}") if val =~ /^["'].*["']$/
+ val = YAML::load( "--- #{val}") if val =~ /^["'].*['"]$/
val.intern
else
raise YAML::Error, "Invalid Symbol: " + val.inspect
@@ -414,9 +414,9 @@ end
YAML.add_ruby_type( /^range/ ) { |type, val|
type, obj_class = YAML.read_type_class( type, ::Range )
- inr = '(\w+|[+-]*\d+(?:\.\d+)?|"(?:[^\\"]|\\.)*")'
+ inr = %r'(\w+|[+-]?\d+(?:\.\d+)?(?:e[+-]\d+)?|"(?:[^\\"]|\\.)*")'
opts = {}
- if String === val and val =~ /^#{inr}(\.{2,3})#{inr}$/
+ if String === val and val =~ /^#{inr}(\.{2,3})#{inr}$/o
r1, rdots, r2 = $1, $2, $3
opts = {
'begin' => YAML.load( "--- #{r1}" ),