X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=toke.c;h=817747630c9937faa30160b9f93d6bf3a1fd1e9b;hb=c22a0cd5b5367764e384c02fc6f17451ad760484;hp=805c9e9b15091a592e55d4dbc490387634b3d537;hpb=b33832a069167d6a3c76b6b99091e3f831db013d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/toke.c b/toke.c index 805c9e9..8177476 100644 --- a/toke.c +++ b/toke.c @@ -3958,7 +3958,8 @@ Perl_yylex(pTHX) s += 2; d = s; s = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, FALSE, &len); - tmp = keyword(PL_tokenbuf, len); + if (!(tmp = keyword(PL_tokenbuf, len))) + Perl_croak(aTHX_ "CORE::%s is not a keyword", PL_tokenbuf); if (tmp < 0) tmp = -tmp; goto reserved_word; @@ -3984,7 +3985,7 @@ Perl_yylex(pTHX) LOP(OP_BIND,XTERM); case KEY_binmode: - UNI(OP_BINMODE); + LOP(OP_BINMODE,XTERM); case KEY_bless: LOP(OP_BLESS,XTERM); @@ -6681,7 +6682,6 @@ Perl_scan_num(pTHX_ char *start) register char *s = start; /* current position in buffer */ register char *d; /* destination in temp buffer */ register char *e; /* end of temp buffer */ - UV tryuv; /* used to see if it can be an UV */ NV value; /* number read, as a double */ SV *sv = Nullsv; /* place to put the converted number */ bool floatit; /* boolean: int or float? */ @@ -6960,15 +6960,17 @@ Perl_scan_num(pTHX_ char *start) Note: if floatit is true, then we don't need to do the conversion at all. */ - tryuv = U_V(value); - if (!floatit && (NV)tryuv == value) { - if (tryuv <= IV_MAX) - sv_setiv(sv, (IV)tryuv); + { + UV tryuv = U_V(value); + if (!floatit && (NV)tryuv == value) { + if (tryuv <= IV_MAX) + sv_setiv(sv, (IV)tryuv); + else + sv_setuv(sv, tryuv); + } else - sv_setuv(sv, tryuv); + sv_setnv(sv, value); } - else - sv_setnv(sv, value); #else /* strtol/strtoll sets errno to ERANGE if the number is too big @@ -6977,22 +6979,14 @@ Perl_scan_num(pTHX_ char *start) */ if (!floatit) { - char *tp; IV iv; UV uv; errno = 0; -#ifdef USE_64_BIT_INT if (*PL_tokenbuf == '-') - iv = strtoll(PL_tokenbuf,&tp,10); + iv = Atol(PL_tokenbuf); else - uv = strtoull(PL_tokenbuf,&tp,10); -#else - if (*PL_tokenbuf == '-') - iv = strtol(PL_tokenbuf,&tp,10); - else - uv = strtoul(PL_tokenbuf,&tp,10); -#endif - if (*tp || errno) + uv = Atoul(PL_tokenbuf); + if (errno) floatit = TRUE; /* probably just too large */ else if (*PL_tokenbuf == '-') sv_setiv(sv, iv); @@ -7002,12 +6996,8 @@ Perl_scan_num(pTHX_ char *start) if (floatit) { char *tp; errno = 0; -#ifdef USE_LONG_DOUBLE - value = strtold(PL_tokenbuf,&tp); -#else - value = strtod(PL_tokenbuf,&tp); -#endif - if (*tp || errno) + value = Atof(PL_tokenbuf); + if (errno) Perl_die(aTHX_ "unparseable float"); else sv_setnv(sv, value); @@ -7020,7 +7010,7 @@ Perl_scan_num(pTHX_ char *start) sv, Nullsv, NULL); break; - /* if it starts with a v, it could be a version number */ + /* if it starts with a v, it could be a v-string */ case 'v': vstring: {