* lib/yaml/rubytypes.rb, lib/yaml/types.rb: using Object#object_id

rather than deprecated Object#id.

* ext/token.c: changed ASCII escapes to octal notation.

* ext/Setup*: added entries for static linking of Syck extension.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
why 2003-05-13 22:29:52 +00:00
Родитель bee670e33a
Коммит 17f705e8cd
10 изменённых файлов: 75 добавлений и 18 удалений

Просмотреть файл

@ -1,3 +1,12 @@
Tue May 13 22:31:04 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
* lib/yaml/rubytypes.rb, lib/yaml/types.rb: using Object#object_id
rather than deprecated Object#id.
* ext/token.c: changed ASCII escapes to octal notation.
* ext/Setup*: added entries for static linking of Syck extension.
Tue May 13 20:31:58 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: add '--Wl,--enable-auto-import' to DLDFLAGS
@ -24,6 +33,16 @@ Tue May 13 14:48:07 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (error_print,error_handle,rb_longjmp,rb_thread_schedule):
ditto.
Tue May 13 06:34:19 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
* lib/yaml/rubytypes.rb: object and struct loading
* lib/yaml.rb: YAML::detect_implicit will discover typing for a Ruby
string
* ext/syck/: Fixed portable comments, misuse of NULL and methods without
return VALUEs.
Mon May 12 18:08:21 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (Init_IO): new variable $deferr which is default output
@ -43,6 +62,26 @@ Sun May 11 13:50:12 2003 Tanaka Akira <akr@m17n.org>
* lib/pp.rb (PP::ObjectMixin#pretty_print): refine to_s handling.
Sun May 11 06:32:13 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
* ext/syck/implicit.c, ext/syck/rubyext.c: transfer methods applied to
native loading
* ext/syck/token.c: fix for transfer methods on same indentation as nested
mapping
* lib/yaml/rubytypes.rb: all type names in lowercase
Sat May 10 19:55:18 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
* ext/syck/gram.c ext/syck/handler.c ext/syck/implicit.c
ext/syck/node.c ext/syck/rubyext.c ext/syck/syck.c
ext/syck/syck.h ext/syck/token.c: updated to Syck 0.27
* lib/yaml/loader.rb: new YAML::Loader class
* lib/yaml.rb: loading of type families leverages YAML::DefaultLoader
Sat May 10 19:00:08 2003 Takaaki Uematsu <uema2x@jcom.home.ne.jp>
* wince/string.c: file removed.
@ -55,6 +94,10 @@ Sat May 10 16:17:02 2003 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/imap.rb (encode_utf7): new method.
Fri May 9 21:25:50 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
* ruby/ext/syck, ruby/lib/yaml: Initial checkin of YAML substances.
Fri May 9 16:38:30 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (rb_io_reopen): It should be possible to reopen closed IO.

Просмотреть файл

@ -22,6 +22,7 @@
#socket
#stringio
#strscan
#syck
#syslog
#tcltklib
#tk

Просмотреть файл

@ -21,6 +21,7 @@ sdbm
socket
stringio
strscan
syck
syslog
#tcltklib
#tk

Просмотреть файл

@ -22,6 +22,7 @@ sdbm
#socket
stringio
strscan
syck
#syslog
#tcltklib
#tk

Просмотреть файл

@ -22,6 +22,7 @@ racc/cparse
socket
stringio
strscan
#syck
#syslog
#tcltklib
#tk

Просмотреть файл

@ -22,6 +22,7 @@ sdbm
socket
stringio
strscan
#syck
#syslog
#tcltklib
#tk

Просмотреть файл

@ -22,6 +22,7 @@ racc/cparse
#socket
stringio
strscan
#syck
#syslog
#tcltklib
#tk

Просмотреть файл

@ -1,4 +1,4 @@
/* Generated by re2c 0.5 on Tue May 13 00:35:24 2003 */
/* Generated by re2c 0.5 on Tue May 13 14:03:13 2003 */
#line 1 "token.re"
/*
* token.re
@ -1231,14 +1231,14 @@ yy156:
{ char ch = *( YYCURSOR - 1 );
switch ( ch )
{
case 'a': ch = '\a'; break;
case 'b': ch = '\b'; break;
case 'e': ch = '\e'; break;
case 'f': ch = '\f'; break;
case 'a': ch = 7; break;
case 'b': ch = '\010'; break;
case 'e': ch = '\033'; break;
case 'f': ch = '\014'; break;
case 'n': ch = '\n'; break;
case 'r': ch = '\r'; break;
case 'r': ch = '\015'; break;
case 't': ch = '\t'; break;
case 'v': ch = '\v'; break;
case 'v': ch = '\013'; break;
}
QUOTECAT(qstr, qcapa, qidx, ch);
goto DoubleQuote2;

Просмотреть файл

@ -2,6 +2,10 @@ require 'date'
#
# Type conversions
#
# Ruby 1.6.x Object#object_id
class Object; alias_method :object_id, :id; end unless Object.respond_to? :object_id
class Object
def is_complex_yaml?
true
@ -13,7 +17,7 @@ class Object
instance_variables.sort
end
def to_yaml( opts = {} )
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
out.map( self.to_yaml_type ) { |map|
to_yaml_properties.each { |m|
map.add( m[1..-1], instance_eval( m ) )
@ -44,7 +48,7 @@ class Hash
end
def to_yaml( opts = {} )
opts[:DocType] = self.class if Hash === opts
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
hash_type = to_yaml_type
if not out.options[:ExplicitTypes] and hash_type == "!map"
hash_type = ""
@ -106,7 +110,7 @@ module YAML
true
end
def to_yaml( opts = {} )
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
out.seq( "!ruby/flexhash" ) { |seq|
self.each { |v|
if v[1]
@ -145,7 +149,7 @@ class Struct
true
end
def to_yaml( opts = {} )
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
#
# Basic struct is passed as a YAML map
#
@ -204,7 +208,7 @@ class Array
end
def to_yaml( opts = {} )
opts[:DocType] = self.class if Hash === opts
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
array_type = to_yaml_type
if not out.options[:ExplicitTypes] and array_type == "!seq"
array_type = ""
@ -252,7 +256,7 @@ class String
complex = true
end
end
YAML::quick_emit( complex ? self.id : nil, opts ) { |out|
YAML::quick_emit( complex ? self.object_id : nil, opts ) { |out|
if complex
if self.is_binary_data?
out.binary_base64( self )
@ -299,7 +303,7 @@ class Symbol
def to_yaml( opts = {} )
YAML::quick_emit( nil, opts ) { |out|
out << "!ruby/sym "
self.id2name.to_yaml( :Emitter => out )
self.object_id2name.to_yaml( :Emitter => out )
}
end
end

Просмотреть файл

@ -1,6 +1,10 @@
#
# Classes required by the full core typeset
#
# Ruby 1.6.x Object#object_id
class Object; alias_method :object_id, :id; end unless Object.respond_to? :object_id
module YAML
#
@ -12,7 +16,7 @@ module YAML
@type_id = type; @value = val
end
def to_yaml( opts = {} )
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
out << " !!#{@type_id}"
value.to_yaml( :Emitter => out )
}
@ -35,7 +39,7 @@ module YAML
"#{dom}/#{@type_id}"
end
def to_yaml( opts = {} )
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
out << " !#{to_yaml_type} "
value.to_yaml( :Emitter => out )
}
@ -95,7 +99,7 @@ module YAML
true
end
def to_yaml( opts = {} )
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
out.seq( "!omap" ) { |seq|
self.each { |v|
seq.add( Hash[ *v ] )
@ -146,7 +150,7 @@ module YAML
true
end
def to_yaml( opts = {} )
YAML::quick_emit( self.id, opts ) { |out|
YAML::quick_emit( self.object_id, opts ) { |out|
out.seq( "!pairs" ) { |seq|
self.each { |v|
seq.add( Hash[ *v ] )