Rename static fcn and PL_parser field

The use of these is being expanded beyond just UTF-8 or not; so change
the names to reflect the more general new purpose
This commit is contained in:
Karl Williamson 2022-02-01 06:33:31 -07:00
parent 25363c821b
commit cfd5dc6c2a
7 changed files with 12 additions and 12 deletions

View File

@ -2359,7 +2359,7 @@ p |void |no_bareword_filehandle \
Tefprv |void |noperl_die |NN const char *pat \
|...
Adp |int |nothreadhook
p |void |notify_parser_that_changed_to_utf8
p |void |notify_parser_that_encoding_changed
: Used in perly.y
Rp |OP * |oopsAV |NN OP *o
: Used in perly.y

View File

@ -1066,7 +1066,7 @@
# define nextargv(a,b) Perl_nextargv(aTHX_ a,b)
# define no_bareword_filehandle(a) Perl_no_bareword_filehandle(aTHX_ a)
# define noperl_die Perl_noperl_die
# define notify_parser_that_changed_to_utf8() Perl_notify_parser_that_changed_to_utf8(aTHX)
# define notify_parser_that_encoding_changed() Perl_notify_parser_that_encoding_changed(aTHX)
# define oopsAV(a) Perl_oopsAV(aTHX_ a)
# define oopsHV(a) Perl_oopsHV(aTHX_ a)
# define op_unscope(a) Perl_op_unscope(aTHX_ a)

2
mg.c
View File

@ -3093,7 +3093,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
/* If wasn't UTF-8, and now is, notify the parser */
if ((PL_hints & HINT_UTF8) && ! (save_hints & HINT_UTF8)) {
notify_parser_that_changed_to_utf8();
notify_parser_that_encoding_changed();
}
}
break;

View File

@ -118,7 +118,7 @@ typedef struct yy_parser {
char sig_slurpy; /* the sigil of the slurpy var (or null) */
bool sig_seen; /* the currently parsing sub has a signature */
bool recheck_utf8_validity;
bool recheck_charset_validity;
PERL_BITFIELD16 in_pod:1; /* lexer is within a =pod section */
PERL_BITFIELD16 filtered:1; /* source filters in evalbytes */

4
proto.h generated
View File

@ -3156,9 +3156,9 @@ Perl_nothreadhook(pTHX);
#define PERL_ARGS_ASSERT_NOTHREADHOOK
PERL_CALLCONV void
Perl_notify_parser_that_changed_to_utf8(pTHX)
Perl_notify_parser_that_encoding_changed(pTHX)
__attribute__visibility__("hidden");
#define PERL_ARGS_ASSERT_NOTIFY_PARSER_THAT_CHANGED_TO_UTF8
#define PERL_ARGS_ASSERT_NOTIFY_PARSER_THAT_ENCODING_CHANGED
PERL_CALLCONV OP *
Perl_oopsAV(pTHX_ OP *o)

2
sv.c
View File

@ -13995,7 +13995,7 @@ Perl_parser_dup(pTHX_ const yy_parser *const proto, CLONE_PARAMS *const param)
parser->sig_elems = proto->sig_elems;
parser->sig_optelems= proto->sig_optelems;
parser->sig_slurpy = proto->sig_slurpy;
parser->recheck_utf8_validity = proto->recheck_utf8_validity;
parser->recheck_charset_validity = proto->recheck_charset_validity;
{
char * const ols = SvPVX(proto->linestr);

10
toke.c
View File

@ -885,7 +885,7 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, U32 flags)
parser->lex_state = LEX_NORMAL;
parser->expect = XSTATE;
parser->rsfp = rsfp;
parser->recheck_utf8_validity = TRUE;
parser->recheck_charset_validity = TRUE;
parser->rsfp_filters =
!(flags & LEX_START_SAME_FILTER) || !oparser
? NULL
@ -1393,7 +1393,7 @@ Perl_lex_discard_to(pTHX_ char *ptr)
}
void
Perl_notify_parser_that_changed_to_utf8(pTHX)
Perl_notify_parser_that_encoding_changed(pTHX)
{
/* Called when $^H is changed to indicate that HINT_UTF8 has changed from
* off to on. At compile time, this has the effect of entering a 'use
@ -1406,7 +1406,7 @@ Perl_notify_parser_that_changed_to_utf8(pTHX)
* the flag is harmless */
if (PL_parser) {
PL_parser->recheck_utf8_validity = TRUE;
PL_parser->recheck_charset_validity = TRUE;
}
}
@ -9674,7 +9674,7 @@ Perl_yylex(pTHX)
{
char *s = PL_bufptr;
if (UNLIKELY(PL_parser->recheck_utf8_validity)) {
if (UNLIKELY(PL_parser->recheck_charset_validity)) {
const U8* first_bad_char_loc;
if (UTF && UNLIKELY(! is_utf8_string_loc((U8 *) PL_bufptr,
PL_bufend - PL_bufptr,
@ -9686,7 +9686,7 @@ Perl_yylex(pTHX)
1 /* 1 means die */ );
NOT_REACHED; /* NOTREACHED */
}
PL_parser->recheck_utf8_validity = FALSE;
PL_parser->recheck_charset_validity = FALSE;
}
DEBUG_T( {
SV* tmp = newSVpvs("");