Project

General

Profile

Bug #752 ยป yaml_datetime.diff

yaml datetime patch - davidw (David Welton), 11/14/2008 01:04 AM

View differences:

/home/davidw/downloads/ruby-1.8.7-p72/ext/syck/rubyext.c 2008-11-13 17:02:20.000000000 +0100
/*
* symbols and constants
*/
static ID s_new, s_utc, s_at, s_to_f, s_to_i, s_read, s_binmode, s_call, s_cmp, s_transfer, s_update, s_dup, s_haskey, s_match, s_keys, s_unpack, s_tr_bang, s_default_set, s_tag_read_class, s_tag_subclasses, s_resolver, s_push, s_emitter, s_level, s_detect_implicit, s_node_import, s_out, s_input, s_intern, s_transform, s_yaml_new, s_yaml_initialize, s_node_export, s_to_yaml, s_write, s_set_resolver;
static ID s_new, s_utc, s_at, s_to_f, s_to_i, s_read, s_binmode, s_call, s_cmp, s_transfer, s_update, s_dup, s_haskey, s_match, s_keys, s_unpack, s_tr_bang, s_default_set, s_tag_read_class, s_tag_subclasses, s_resolver, s_push, s_emitter, s_level, s_detect_implicit, s_node_import, s_out, s_input, s_intern, s_transform, s_yaml_new, s_yaml_initialize, s_node_export, s_to_yaml, s_write, s_set_resolver, s_parse;
static ID s_tags, s_domain, s_kind, s_name, s_options, s_type_id, s_type_id_set, s_style, s_style_set, s_value, s_value_set;
static VALUE sym_model, sym_generic, sym_input, sym_bytecode;
static VALUE sym_scalar, sym_seq, sym_map;
static VALUE sym_1quote, sym_2quote, sym_fold, sym_literal, sym_plain, sym_inline;
static VALUE cDate, cNode, cMap, cSeq, cScalar, cOut, cParser, cResolver, cPrivateType, cDomainType, cYObject, cBadAlias, cDefaultKey, cMergeKey, cEmitter;
static VALUE cDate, cDateTime, cNode, cMap, cSeq, cScalar, cOut, cParser, cResolver, cPrivateType, cDomainType, cYObject, cBadAlias, cDefaultKey, cMergeKey, cEmitter;
static VALUE oDefaultResolver, oGenericResolver;
/*
......
}
else if ( strcmp( type_id, "timestamp#iso8601" ) == 0 )
{
obj = rb_syck_mktime( n->data.str->ptr, n->data.str->len );
if ( !cDateTime ) {
/*
* Load Date module
*/
rb_require( "date" );
cDateTime = rb_const_get( rb_cObject, rb_intern("DateTime") );
}
obj = rb_funcall( cDateTime, s_parse, 1,
rb_str_new( n->data.str->ptr, n->data.str->len ));
rb_require( "date" );
}
else if ( strcmp( type_id, "timestamp#spaced" ) == 0 )
{
......
s_transform = rb_intern( "transform" );
s_yaml_new = rb_intern("yaml_new");
s_yaml_initialize = rb_intern("yaml_initialize");
s_parse = rb_intern("parse");
s_tags = rb_intern("@tags");
s_name = rb_intern("@name");
    (1-1/1)