summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-10-13 10:27:36 +0100
committerNicholas Clark <nick@ccl4.org>2009-10-13 10:27:36 +0100
commit8290c3237cb4f93c9895ceba724c626dd529346f (patch)
tree6bc1bb32b5580e5417fca0746c405d661a50124d /toke.c
parenta4df5da1fe962395b9ad9ab6a0922d022fdb809c (diff)
downloadperl-8290c3237cb4f93c9895ceba724c626dd529346f.tar.gz
Move the code related to deprecate("comma-less variable list") into a function.
This makes all calls to deprecate() string constants.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/toke.c b/toke.c
index 03cf6fd6e3..dc87f278db 100644
--- a/toke.c
+++ b/toke.c
@@ -100,7 +100,6 @@ static int
S_pending_ident(pTHX);
static const char ident_too_long[] = "Identifier too long";
-static const char commaless_variable_list[] = "comma-less variable list";
#ifndef PERL_NO_UTF16_FILTER
static I32 utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen);
@@ -451,6 +450,13 @@ S_printbuf(pTHX_ const char *const fmt, const char *const s)
#endif
+static int
+S_deprecate_commaless_var_list(pTHX) {
+ PL_expect = XTERM;
+ deprecate("comma-less variable list");
+ return REPORT(','); /* grandfather non-comma-format format */
+}
+
/*
* S_ao
*
@@ -4860,9 +4866,7 @@ Perl_yylex(pTHX)
if (PL_expect == XOPERATOR) {
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
- PL_expect = XTERM;
- deprecate(commaless_variable_list);
- return REPORT(','); /* grandfather non-comma-format format */
+ return deprecate_commaless_var_list();
}
}
@@ -5118,9 +5122,7 @@ Perl_yylex(pTHX)
DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
if (PL_expect == XOPERATOR) {
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
- PL_expect = XTERM;
- deprecate(commaless_variable_list);
- return REPORT(','); /* grandfather non-comma-format format */
+ return deprecate_commaless_var_list();
}
else
no_op("String",s);
@@ -5135,9 +5137,7 @@ Perl_yylex(pTHX)
DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
if (PL_expect == XOPERATOR) {
if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) {
- PL_expect = XTERM;
- deprecate(commaless_variable_list);
- return REPORT(','); /* grandfather non-comma-format format */
+ return deprecate_commaless_var_list();
}
else
no_op("String",s);