Fully spell out "subroutine" and "variable"

A bunch of places were using "%se" and "subroutin" or "variabl" when
generating error messages that could refer to either a subroutine or
variable.  Spell the words out and use plain "%s" instead.
This commit is contained in:
Dagfinn Ilmari Mannsåker 2019-10-19 15:36:30 +02:00
parent 5015bd0bb5
commit eeaa50cc8b
3 changed files with 9 additions and 9 deletions

10
pad.c
View File

@ -1086,10 +1086,10 @@ S_unavailable(pTHX_ PADNAME *name)
{
/* diag_listed_as: Variable "%s" is not available */
Perl_ck_warner(aTHX_ packWARN(WARN_CLOSURE),
"%se \"%" PNf "\" is not available",
"%s \"%" PNf "\" is not available",
*PadnamePV(name) == '&'
? "Subroutin"
: "Variabl",
? "Subroutine"
: "Variable",
PNfARG(name));
}
@ -1205,8 +1205,8 @@ S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, U32 flags, const CV* cv,
/* diag_listed_as: Variable "%s" will not stay
shared */
Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
"%se \"%" UTF8f "\" will not stay shared",
*namepv == '&' ? "Subroutin" : "Variabl",
"%s \"%" UTF8f "\" will not stay shared",
*namepv == '&' ? "Subroutine" : "Variable",
UTF8fARG(1, namelen, namepv));
}

2
perl.h
View File

@ -4605,7 +4605,7 @@ EXTCONST char PL_no_dir_func[]
EXTCONST char PL_no_func[]
INIT("The %s function is unimplemented");
EXTCONST char PL_no_myglob[]
INIT("\"%s\" %se %s can't be in a package");
INIT("\"%s\" %s %s can't be in a package");
EXTCONST char PL_no_localize_ref[]
INIT("Can't localize through a reference");
EXTCONST char PL_memory_wrap[]

6
toke.c
View File

@ -9343,8 +9343,8 @@ S_pending_ident(pTHX)
/* diag_listed_as: No package name allowed for variable %s
in "our" */
yyerror_pv(Perl_form(aTHX_ "No package name allowed for "
"%se %s in \"our\"",
*PL_tokenbuf=='&' ?"subroutin":"variabl",
"%s %s in \"our\"",
*PL_tokenbuf=='&' ? "subroutine" : "variable",
PL_tokenbuf), UTF ? SVf_UTF8 : 0);
tmp = allocmy(PL_tokenbuf, tokenbuf_len, UTF ? SVf_UTF8 : 0);
}
@ -9356,7 +9356,7 @@ S_pending_ident(pTHX)
GCC_DIAG_IGNORE_STMT(-Wformat-nonliteral);
yyerror_pv(Perl_form(aTHX_ PL_no_myglob,
PL_in_my == KEY_my ? "my" : "state",
*PL_tokenbuf == '&' ? "subroutin" : "variabl",
*PL_tokenbuf == '&' ? "subroutine" : "variable",
PL_tokenbuf),
UTF ? SVf_UTF8 : 0);
GCC_DIAG_RESTORE_STMT;