mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/syck/token.c: re2c no longer compiled with bit vectors. caused
problems for non-ascii characters. [ruby-core:03280] * ext/syck/implicit.c: ditto. * ext/syck/bytecode.c: ditto. * lib/yaml/baseemitter.rb: folding now handles double-quoted strings, fixed problem with extra line feeds at end of folding, whitespace opening scalar blocks. * lib/yaml/rubytypes.rb: subtelties in handling strings with non-printable characters and odd whitespace patterns. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
157832d922
commit
e1f2cdb6a5
7 changed files with 3877 additions and 2013 deletions
|
@ -315,25 +315,24 @@ class String
|
|||
}
|
||||
elsif self.is_binary_data?
|
||||
out.binary_base64( self )
|
||||
# elsif self =~ /^ |#{YAML::ESCAPE_CHAR}| $/
|
||||
# complex = false
|
||||
elsif self =~ /#{YAML::ESCAPE_CHAR}/
|
||||
out.node_text( self, '"' )
|
||||
else
|
||||
out.node_text( self, to_yaml_fold )
|
||||
end
|
||||
end
|
||||
if not complex
|
||||
else
|
||||
ostr = if out.options(:KeepValue)
|
||||
self
|
||||
elsif empty?
|
||||
"''"
|
||||
elsif self =~ /^[^#{YAML::WORD_CHAR}\/]| \#|#{YAML::ESCAPE_CHAR}|[#{YAML::SPACE_INDICATORS}]( |$)| $|\n|\'/
|
||||
"\"#{YAML.escape( self )}\""
|
||||
out.node_text( self, '"' ); nil
|
||||
elsif YAML.detect_implicit( self ) != 'str'
|
||||
"\"#{YAML.escape( self )}\""
|
||||
out.node_text( self, '"' ); nil
|
||||
else
|
||||
self
|
||||
end
|
||||
out.simple( ostr )
|
||||
out.simple( ostr ) unless ostr.nil?
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue