diff options
author | Yves Orton <demerphq@gmail.com> | 2023-02-25 15:21:14 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-03-18 21:00:54 +0800 |
commit | d81b4f9331172ed96e5382fe1e1091e9d4b85495 (patch) | |
tree | a34de6f2d0c902c72aede41423528afaca271a36 /toke.c | |
parent | 905584a6fe44cfcb198cc15af5e082ceb57ccf85 (diff) | |
download | perl-d81b4f9331172ed96e5382fe1e1091e9d4b85495.tar.gz |
warnings.pm - support deprecated::smartmatch category
Currently we seem to lack a way to have a subcategory under deprecated.
It seems reasonable to me that people might want to disable a specific
subcategory warning while leaving the rest in place. This patch allows
that. Note that both
no warnings "deprecated";
and
no warnings "deprecated::smartmatch";
work to disable the warning. Deprecated warnings shouldn't be "all or
nothing", they should be specific and targetted.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -6638,7 +6638,7 @@ yyl_tilde(pTHX_ char *s) TOKEN(0); s += 2; Perl_ck_warner_d(aTHX_ - packWARN(WARN_DEPRECATED), + packWARN(WARN_DEPRECATED__SMARTMATCH), "Smartmatch is deprecated"); NCEop(OP_SMARTMATCH); } @@ -8179,7 +8179,7 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct case KEY_given: pl_yylval.ival = CopLINE(PL_curcop); - Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), + Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED__SMARTMATCH), "given is deprecated"); OPERATOR(KW_GIVEN); @@ -8702,7 +8702,7 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct return REPORT(0); pl_yylval.ival = CopLINE(PL_curcop); Perl_ck_warner_d(aTHX_ - packWARN(WARN_DEPRECATED), + packWARN(WARN_DEPRECATED__SMARTMATCH), "when is deprecated"); OPERATOR(KW_WHEN); |