From c2269d5b4f60829a523f3479492267ef99e1c5fb Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 1 Feb 2002 10:23:22 +0000 Subject: * intern.h: prototypes for new functions; rb_cstr_to_inum(), rb_str_to_inum(), rb_cstr_to_dbl(), rb_str_to_dbl() * bignum.c (rb_cstr_to_inum): changed from rb_cstr2inum(), and added argument badcheck to be consistent with parser. [new] * bignum.c (rb_str_to_inum): ditto. * bignum.c (rb_cstr2inum): wapper of rb_cstr_to_inum() now. * bignum.c (rb_str2inum): ditto. * object.c (rb_cstr_to_dbl): float number parser. [new] * object.c (rb_str_to_dbl): ditto. * object.c (rb_Float): use rb_cstr_to_dbl() for strict check. * object.c (rb_Integer): use rb_str_to_inum() for strict check. * string.c (rb_str_to_f): use rb_str_to_dbl() with less check. * string.c (rb_str_to_i): use rb_str_to_inum() with less check. * string.c (rb_str_hex): ditto. * string.c (rb_str_oct): ditto. * sprintf.c (rb_f_sprintf): ditto. * time.c (obj2long): ditto. * parse.y (yylex): use rb_cstr_to_inum() for strict check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 481927ec42..0081e9fa81 100644 --- a/parse.y +++ b/parse.y @@ -3345,7 +3345,7 @@ yylex() yyerror("hexadecimal number without hex-digits"); } else if (nondigit) goto trailing_uc; - yylval.val = rb_cstr2inum(tok(), 16); + yylval.val = rb_cstr_to_inum(tok(), 16, Qfalse); return tINTEGER; } if (c == 'b' || c == 'B') { @@ -3369,7 +3369,7 @@ yylex() yyerror("numeric literal without digits"); } else if (nondigit) goto trailing_uc; - yylval.val = rb_cstr2inum(tok(), 2); + yylval.val = rb_cstr_to_inum(tok(), 2, Qfalse); return tINTEGER; } if (c >= '0' && c <= '7' || c == '_') { @@ -3388,7 +3388,7 @@ yylex() pushback(c); tokfix(); if (nondigit) goto trailing_uc; - yylval.val = rb_cstr2inum(tok(), 8); + yylval.val = rb_cstr_to_inum(tok(), 8, Qfalse); return tINTEGER; } } @@ -3482,7 +3482,7 @@ yylex() yylval.val = rb_float_new(d); return tFLOAT; } - yylval.val = rb_cstr2inum(tok(), 10); + yylval.val = rb_cstr_to_inum(tok(), 10, Qfalse); return tINTEGER; } -- cgit v1.2.3