mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/implicit.c: added sexagecimal float#base60.
* ext/syck/rubyext.c (yaml_org_handler): ditto. * lib/token.c: indentation absolutely ignored when processing flow collections. plain scalars are trimmed if indentation follows in an ambiguous flow collection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5190564b68
commit
e3619768b1
5 changed files with 1390 additions and 2949 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Sun Aug 8 00:43:31 2004 why the lucky stiff <why@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/implicit.c: added sexagecimal float#base60.
|
||||||
|
|
||||||
|
* ext/syck/rubyext.c (yaml_org_handler): ditto.
|
||||||
|
|
||||||
|
* lib/token.c: indentation absolutely ignored when processing flow
|
||||||
|
collections. plain scalars are trimmed if indentation follows in
|
||||||
|
an ambiguous flow collection.
|
||||||
|
|
||||||
Sat Aug 7 00:50:01 2004 Tanaka Akira <akr@m17n.org>
|
Sat Aug 7 00:50:01 2004 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* ext/zlib/zlib.c: Zlib::GzipReader#read(0) returns "" instead of nil.
|
* ext/zlib/zlib.c: Zlib::GzipReader#read(0) returns "" instead of nil.
|
||||||
|
|
3766
ext/syck/implicit.c
3766
ext/syck/implicit.c
File diff suppressed because it is too large
Load diff
|
@ -482,6 +482,31 @@ yaml_org_handler( n, ref )
|
||||||
syck_str_blow_away_commas( n );
|
syck_str_blow_away_commas( n );
|
||||||
obj = rb_cstr2inum( n->data.str->ptr, 10 );
|
obj = rb_cstr2inum( n->data.str->ptr, 10 );
|
||||||
}
|
}
|
||||||
|
else if ( strcmp( type_id, "float#base60" ) == 0 )
|
||||||
|
{
|
||||||
|
char *ptr, *end;
|
||||||
|
long sixty = 1;
|
||||||
|
double total = 0.0;
|
||||||
|
syck_str_blow_away_commas( n );
|
||||||
|
ptr = n->data.str->ptr;
|
||||||
|
end = n->data.str->ptr + n->data.str->len;
|
||||||
|
while ( end > ptr )
|
||||||
|
{
|
||||||
|
double bnum = 0;
|
||||||
|
char *colon = end - 1;
|
||||||
|
while ( colon >= ptr && *colon != ':' )
|
||||||
|
{
|
||||||
|
colon--;
|
||||||
|
}
|
||||||
|
if ( *colon == ':' ) *colon = '\0';
|
||||||
|
|
||||||
|
bnum = strtod( colon + 1, NULL );
|
||||||
|
total += bnum * sixty;
|
||||||
|
sixty *= 60;
|
||||||
|
end = colon;
|
||||||
|
}
|
||||||
|
obj = rb_float_new( total );
|
||||||
|
}
|
||||||
else if ( strcmp( type_id, "float#nan" ) == 0 )
|
else if ( strcmp( type_id, "float#nan" ) == 0 )
|
||||||
{
|
{
|
||||||
obj = rb_float_new( S_nan() );
|
obj = rb_float_new( S_nan() );
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#define SYCK_YAML_MAJOR 1
|
#define SYCK_YAML_MAJOR 1
|
||||||
#define SYCK_YAML_MINOR 0
|
#define SYCK_YAML_MINOR 0
|
||||||
|
|
||||||
#define SYCK_VERSION "0.44"
|
#define SYCK_VERSION "0.45"
|
||||||
#define YAML_DOMAIN "yaml.org,2002"
|
#define YAML_DOMAIN "yaml.org,2002"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
536
ext/syck/token.c
536
ext/syck/token.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue