1
0
Fork 0
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/branches/ruby_1_8@6742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
why 2004-08-07 15:40:47 +00:00
parent 7d8e1d714b
commit 7096955908
6 changed files with 1401 additions and 2960 deletions

View file

@ -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>
* ext/zlib/zlib.c: Zlib::GzipReader#read(0) returns "" instead of nil.

View file

@ -351,8 +351,8 @@ static const unsigned short yyrline[] =
184, 194, 195, 196, 197, 198, 204, 210, 216, 217,
222, 227, 232, 237, 241, 247, 251, 256, 265, 269,
275, 279, 286, 287, 293, 298, 305, 310, 315, 320,
325, 329, 335, 350, 351, 369, 370, 382, 390, 399,
407, 411, 417, 418, 427, 434
325, 329, 335, 350, 351, 368, 369, 381, 389, 398,
406, 410, 416, 417, 426, 433
};
#endif
@ -1476,7 +1476,7 @@ yyreduce:
break;
case 66:
#line 371 "gram.y"
#line 370 "gram.y"
{
if ( yyvsp[-2].nodeData->shortcut == NULL )
{
@ -1491,7 +1491,7 @@ yyreduce:
break;
case 67:
#line 383 "gram.y"
#line 382 "gram.y"
{
apply_seq_in_map( (SyckParser *)parser, yyvsp[-2].nodeData );
syck_map_update( yyvsp[-2].nodeData, yyvsp[0].nodeData );
@ -1502,14 +1502,14 @@ yyreduce:
break;
case 68:
#line 391 "gram.y"
#line 390 "gram.y"
{
yyval.nodeData = yyvsp[-1].nodeData;
}
break;
case 69:
#line 400 "gram.y"
#line 399 "gram.y"
{
yyval.nodeData = syck_new_map(
syck_hdlr_add_node( (SyckParser *)parser, yyvsp[-2].nodeData ),
@ -1518,21 +1518,21 @@ yyreduce:
break;
case 70:
#line 408 "gram.y"
#line 407 "gram.y"
{
yyval.nodeData = yyvsp[-1].nodeData;
}
break;
case 71:
#line 412 "gram.y"
#line 411 "gram.y"
{
yyval.nodeData = syck_alloc_map();
}
break;
case 73:
#line 419 "gram.y"
#line 418 "gram.y"
{
syck_map_update( yyvsp[-2].nodeData, yyvsp[0].nodeData );
syck_free_node( yyvsp[0].nodeData );
@ -1542,7 +1542,7 @@ yyreduce:
break;
case 74:
#line 428 "gram.y"
#line 427 "gram.y"
{
NULL_NODE( parser, n );
yyval.nodeData = syck_new_map(
@ -1774,7 +1774,7 @@ yyreturn:
}
#line 437 "gram.y"
#line 436 "gram.y"
void

File diff suppressed because it is too large Load diff

View file

@ -482,6 +482,31 @@ yaml_org_handler( n, ref )
syck_str_blow_away_commas( n );
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 )
{
obj = rb_float_new( S_nan() );

View file

@ -13,7 +13,7 @@
#define SYCK_YAML_MAJOR 1
#define SYCK_YAML_MINOR 0
#define SYCK_VERSION "0.44"
#define SYCK_VERSION "0.45"
#define YAML_DOMAIN "yaml.org,2002"
#include <stdio.h>

File diff suppressed because it is too large Load diff