Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions regen/embed.pl
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,35 @@ BEGIN
pod/perlreapi.pod
);

# A regular expression that matches names that are externally visible, but
# Perl reserves for itself. Generally, we want things to be delimitted on
# both sides to show it isn't part of a larger word such as 'hyperlink',
# 'perlustrate', or 'properly'. Underscores delimit besides the typical ^ or
# \b. All caps PERL has looser rules to accommodate the many existing symbols
# where everything is jammed together, and the less likelihood that something
# with all caps is innocently referring to something unrelated to Perl.
my $names_reserved_for_perl_use_re =
qr/ ^ ( PL_ \w+ \b
| perl_ # The underscore delimits
| Perl [_A-Z] # Uppercase delimits here too
| PERL [A-Z]+ [[:alpha:]] ( \b | _ )
)

# The \d is for PERL5, for example
| ( _ | \b ) PERL ( _ | \b | \d+ )

# This is for obsolete and deprecated uses
| ( _ | \b ) CPERL (arg | scope) ( _ | \b )
/x;

# This is a list of symbols that are not documented to be available for
# modules to use, but are nevertheless currently not kept by embed.h from
# being visible to the world.
#
# Strive to make this list empty.
#
# The list does not include symbols that we have documented as being reserved
# for perl's use, namely those that begin with 'PL_' or contain qr/perl/i.
# for perl's use, namely those that match the pattern just above.
# There are two parts of the list; the second part contains the symbols which
# have a trailing underscore; the first part those without.
#
Expand Down Expand Up @@ -1336,6 +1357,8 @@ BEGIN
is_XDIGIT_high
isXDIGIT_LC_utf8
isXDIGIT_uni
is_XPERLSPACE_cp_high
is_XPERLSPACE_high
IV_DIG
IV_MAX_P1
JE_OLD_STACK_HWM_restore
Expand Down Expand Up @@ -4729,9 +4752,7 @@ sub find_undefs {
# Just the symbol, no arglist nor definition
$name =~ s/ (?: \s | \( ) .* //x;

# These are reserved for Perl's use, so not a problem.
next if $name =~ / ^ PL_ /x;
next if $name =~ /perl/i;
next if $name =~ $names_reserved_for_perl_use_re;

next unless $line->reduce_conds($constraints_re,
\%constraints);
Expand Down
Loading