diff options
author | Zefram <zefram@fysh.org> | 2010-04-30 20:23:59 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-05-03 16:27:38 +0200 |
commit | 1183a10042af0734ee65e252f15bd820b7bbe686 (patch) | |
tree | 3654c6aa7af319c12327fa8df46f848848ffb23c /toke.c | |
parent | 9702b155e486f017ed2d6a28ec16132482f38d90 (diff) | |
download | perl-1183a10042af0734ee65e252f15bd820b7bbe686.tar.gz |
tweak "0x123.456" deprecation
Some improvements to the deprecation added in commit
6fb472bab4fadd0ae2ca9624b74596afab4fb8cb:
- warning message includes the word "deprecated"
- warning is in "syntax" category as well as "deprecated"
- more systematic tests
- dot detected more efficiently by incorporation into existing switch
- small doc rewording
- avoid the warning in t/op/taint.t
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -13014,6 +13014,18 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) switch (*s) { + case '.': + /* Dot here is historically concat, not a radix point. + Deprecate that; it's confusing, and gets in the way of + hex(ish) fractions... but '..' is OK. */ + if (s[1] != '.') { + Perl_ck_warner_d(aTHX_ + packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + "Dot after %s literal is deprecated concatenation", + base); + } + /* FALL THROUGH */ + /* if we don't mention it, we're done */ default: goto out; @@ -13096,15 +13108,6 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp) Perl_ck_warner(aTHX_ packWARN(WARN_SYNTAX), "Misplaced _ in number"); } - /* Dot here is historically concat, not a radix point. - Deprecate that; it's confusing, and gets in the way of - hex(ish) fractions... but '..' is OK. */ - if (s[0] == '.' && - s[1] != '.') { - Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), - "Dot after %s literal is concatenation", base); - } - sv = newSV(0); if (overflowed) { if (n > 4294967295.0) |