1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/syck/token.c: preserve newlines prepended to a block.

* ext/syck/implicit.c (syck_match_implicit): added !merge and !default.

* lib/yaml/constants.rb: remove '\z' escape.

* lib/yaml/emitter.rb: ensure reset of @seq_map shortcut flag.

* lib/yaml/encoding.rb: remove Unicode translation methods.

* lib/yaml/rubytypes.rb: improved round-tripping of Strings.
  [ruby-core:1134]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
why 2003-06-10 14:15:27 +00:00
parent 3079dcab4a
commit e921ea2d78
7 changed files with 2019 additions and 1967 deletions

View file

@ -60,6 +60,7 @@ module YAML
# Emit plain, normal flowing text
#
def node_text( value, block = '>' )
@seq_map = false
valx = value.dup
if @options[:UseBlock]
block = '|'
@ -89,6 +90,7 @@ module YAML
# Emit a simple, unqouted string
#
def simple( value )
@seq_map = false
self << value.to_s
end
@ -168,6 +170,7 @@ module YAML
#
if val.length.zero?
self << "{}"
@seq_map = false
else
if @buffer.length == 1 and @options[:UseHeader] == false and type.length.zero?
@headless = 1
@ -213,6 +216,7 @@ module YAML
# Quick sequence
#
def seq( type, &e )
@seq_map = false
val = Sequence.new
e.call( val )
self << "#{type} " if type.length.nonzero?
@ -282,7 +286,7 @@ module YAML
@buffer.push( "" )
#p [ self.id, @level, :END ]
if @level < 0
YAML.internal_to_utf( header + @buffer.to_s[@headless..-1], @options[:Encoding] )
header + @buffer.to_s[@headless..-1]
end
end
end