This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
3 years agoparts/inc/inctools: Add sort fcn of API lines
Karl Williamson [Tue, 13 Aug 2019 04:37:44 +0000 (22:37 -0600)]
parts/inc/inctools: Add sort fcn of API lines

These lines have the name be the 3rd field with separator '|'

(cherry picked from commit 7f9278b13869baea6e8b01690990c71ff3ce8838)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Convert to use parse_version
Karl Williamson [Sat, 20 Jul 2019 21:00:56 +0000 (15:00 -0600)]
parts/apicheck.pl: Convert to use parse_version

This function is now suitable here, instead of duplicating logic

(cherry picked from commit 9a55a3a3baf52d0d53571f576f6dc69d915220eb)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/inc/inctools: Add fcn to return integer version
Karl Williamson [Sat, 20 Jul 2019 23:22:36 +0000 (17:22 -0600)]
parts/inc/inctools: Add fcn to return integer version

This is a Perl version of the C macro PERL_BCDVERSION, so the value
returned can be used  as the file names in parts/base and parts/todo,
and is easy to compare.

(cherry picked from commit 7be255fab4621aecfe8192ea2fa2d4aa842067f4)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/inc/inctools: Rewrite parse_version
Karl Williamson [Sat, 20 Jul 2019 20:52:09 +0000 (14:52 -0600)]
parts/inc/inctools: Rewrite parse_version

This now accepts more input formats than before, and dies when wrong
with the same messages that ppport.h uses, so that the latter can now
convert to use this function.

And, importantly, it fixes a bug where the lowest component of version
numbers in early perls was multiplied by 10.

(cherry picked from commit 38f1e0a218ae97b719e1cd048bde157d08dd3f37)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/inc/parse_version: Call fcn to not duplicate logic
Karl Williamson [Thu, 18 Jul 2019 20:42:22 +0000 (14:42 -0600)]
parts/inc/parse_version: Call fcn to not duplicate logic

Change to avoid redundant code; add comment

(cherry picked from commit b02f52889c1a5d1d79cb91fd545ce9f6c454c963)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoSort a bunch of outputs in dictionary order
Karl Williamson [Sat, 20 Jul 2019 20:12:11 +0000 (14:12 -0600)]
Sort a bunch of outputs in dictionary order

Makes them easier to read

(cherry picked from commit 2d3877590e755fab8a115cd49bb99953dee5d516)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoExtract duplicate common subs into common file
Karl Williamson [Thu, 18 Jul 2019 20:31:56 +0000 (14:31 -0600)]
Extract duplicate common subs into common file

These had gotten slightly out of sync.  This file is in parts/inc, as it
needs to be expanded as part of ppport.h

(cherry picked from commit cfa14856d571b28a8542c3285990b105c2923d71)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoUpdate minimum perl version to 5.003_07
Karl Williamson [Wed, 10 Jul 2019 23:17:51 +0000 (17:17 -0600)]
Update minimum perl version to 5.003_07

It used to say plain 5.003, but for many years the earliest data had
been 5.003_07.  I have tested it back to there and think this is good
enough.  This is actually quite early in the 5.003 cycle.  If we wanted
to try another 5.003, it would be more likely 5.003_97 which perlhist
says was widely used, but is real close to 5.004

(cherry picked from commit 1dd8b06856003dc87de669ef8356e66eb30985f9)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoPPPort_pm.PL: Prototypes differing only in pTHX_
Karl Williamson [Fri, 12 Jul 2019 16:43:35 +0000 (10:43 -0600)]
PPPort_pm.PL: Prototypes differing only in pTHX_

Use special wording for these, as this can be an unavoidable issue for
very early perls that don't port thread context back that far.

(cherry picked from commit b8a73dca70de398e16e70857f461cc88d99ac5c8)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoPPPort_pm.PL: Note the functions that are special
Karl Williamson [Fri, 12 Jul 2019 19:19:35 +0000 (13:19 -0600)]
PPPort_pm.PL: Note the functions that are special

Special meaning deprecated, experimental, or not documented

(cherry picked from commit ae56cb8010ec0ad4487040218ec6f90924908eb2)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoPPPort_pm.PL: Move some includes to earlier
Karl Williamson [Fri, 12 Jul 2019 19:18:57 +0000 (13:18 -0600)]
PPPort_pm.PL: Move some includes to earlier

These need to be defined earlier to work on very early perls

(cherry picked from commit ed2f32accaedeed3f4b4471c831503263e65fa6a)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoPPPort_pm.PL: Add/fix comments, pod
Karl Williamson [Thu, 8 Aug 2019 17:51:28 +0000 (11:51 -0600)]
PPPort_pm.PL: Add/fix comments, pod

(cherry picked from commit 04a21a21f6a7cbbb24e10848f5483f35be516936)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agobuildperl.pl: Add pod/usage info
Karl Williamson [Mon, 8 Jul 2019 20:38:18 +0000 (14:38 -0600)]
buildperl.pl: Add pod/usage info

(cherry picked from commit cc4f886f095f23621d29ae3f1a472bda71b92b12)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agobuildperl.pl: Don't try to install man pages
Karl Williamson [Mon, 8 Jul 2019 20:35:05 +0000 (14:35 -0600)]
buildperl.pl: Don't try to install man pages

(cherry picked from commit 0a183db5b6138fcded66ba407a3d8216734d7e70)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agobuildperl.pl: Don't die if make install returns >0
Karl Williamson [Mon, 8 Jul 2019 20:32:29 +0000 (14:32 -0600)]
buildperl.pl: Don't die if make install returns >0

Sometimes 'make install' returns non-success even if it actually
installed enough for our purposes.

(cherry picked from commit c3f61c3653ab3e67676930f49fd5e16f45e3df4f)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agobuildperl.pl: Add ability to build in parallel
Karl Williamson [Mon, 8 Jul 2019 20:30:11 +0000 (14:30 -0600)]
buildperl.pl: Add ability to build in parallel

This allows you to manually call this with a -j parameter to give the
number of parallel jobs to run, default 1.

(cherry picked from commit baffbaef885a245b50c5c20dc60b4dc180615433)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agodevtools.pl: Re-prompt if user typed wrong
Karl Williamson [Mon, 8 Jul 2019 20:36:19 +0000 (14:36 -0600)]
devtools.pl: Re-prompt if user typed wrong

Previously it just waited for the user to type the right thing without
prompting that it was doing so.

It also prints a BEL character to notify that attention is needed.

(cherry picked from commit 4b79a8599508f7ad03e4f6e8b62062f5ba989969)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoHandle "literal string" args
Karl Williamson [Wed, 14 Aug 2019 22:42:46 +0000 (16:42 -0600)]
Handle "literal string" args

Some of the macros in perl require an argument to be a literal C string,
that is, one enclosed in quotation marks.  This change causes trim_arg()
to recognize these and return them properly, and apicheck.pl to use the
passed string directly as the argument.

(cherry picked from commit bc85e4126fa938abcaecadef4cbd8678da215250)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Special case things like _aTHX
Karl Williamson [Wed, 14 Aug 2019 03:34:00 +0000 (21:34 -0600)]
parts/apicheck.pl: Special case things like _aTHX

A few macros have a leading underscore to indicate a comma.  This adds
code to handle them.  I made separate variabled for threaded and maybe
non-threaded, but I don't know if the latter actually happens.

(cherry picked from commit 1187530614591229d1a4f1d7b2989439b1038861)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Add declarations for MY_CXT testing
Karl Williamson [Wed, 14 Aug 2019 03:17:58 +0000 (21:17 -0600)]
parts/apicheck.pl: Add declarations for MY_CXT testing

(cherry picked from commit aed2f395177f375003a5eecdc9535ac1e22c7f93)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Handle macros with trailing '_'
Karl Williamson [Tue, 6 Aug 2019 21:50:56 +0000 (15:50 -0600)]
parts/apicheck.pl: Handle macros with trailing '_'

The underscore represents a comma when expanded.  This commit makes this
program handle it.

(cherry picked from commit 12c850af3cce16d98a6a316b41a6992cfe6c6bda)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: A couple better diagnosics
Karl Williamson [Tue, 6 Aug 2019 21:49:54 +0000 (15:49 -0600)]
parts/apicheck.pl: A couple better diagnosics

(cherry picked from commit efe0e70e31d29bb9fdafee482bc4652151973f31)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Add special parameter name 'block'
Karl Williamson [Tue, 6 Aug 2019 21:47:10 +0000 (15:47 -0600)]
parts/apicheck.pl: Add special parameter name 'block'

A new macro has been added to blead that has a parameter that can be a C
block.  This can easily be accommodated by the code in this file, if we
know about how to handle it.

(cherry picked from commit 2095204694d4f9df74463fc45d58b441759de865)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Add white-space to m//x for readability
Karl Williamson [Wed, 14 Aug 2019 19:04:14 +0000 (13:04 -0600)]
parts/apicheck.pl: Add white-space to m//x for readability

And some comments to regex

(cherry picked from commit a76243946786233602fab339e55b29851c3785e9)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Silence warnings on old perls
Karl Williamson [Sun, 14 Jul 2019 16:01:59 +0000 (10:01 -0600)]
parts/apicheck.pl: Silence warnings on old perls

A hash element wasn't always automatically quoted: {foo} warned, {'foo'}
doesn't.

(cherry picked from commit 2a1fab422eb86442cc09296f3fe03d027e9c7254)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Add a few comments; white-space
Karl Williamson [Tue, 2 Jul 2019 16:52:45 +0000 (10:52 -0600)]
parts/apicheck.pl: Add a few comments; white-space

(cherry picked from commit fc50937fba868cf630ba6ccedd83d88a307ea81f)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Ignore some hard-to-handle functions
Karl Williamson [Tue, 2 Jul 2019 16:49:25 +0000 (10:49 -0600)]
parts/apicheck.pl: Ignore some hard-to-handle functions

These are hard to get to work, so punt.

(cherry picked from commit 5e34d4c395ed0f10bae66d83e8ac0ab5264197bd)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: BOOTCHECK needs some declarations to compile
Karl Williamson [Tue, 2 Jul 2019 16:48:39 +0000 (10:48 -0600)]
parts/apicheck.pl: BOOTCHECK needs some declarations to compile

(cherry picked from commit 5490382d8d66af8e7a06103b6fc74baa90c6c7d0)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: MULTICALL needs declarations to compile
Karl Williamson [Tue, 2 Jul 2019 16:46:18 +0000 (10:46 -0600)]
parts/apicheck.pl: MULTICALL needs declarations to compile

(cherry picked from commit 27cc0c8cf320818b8d81ec0f0ddd9e1f71cb1a38)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Sort some lists
Karl Williamson [Tue, 2 Jul 2019 16:39:21 +0000 (10:39 -0600)]
parts/apicheck.pl: Sort some lists

This makes it easier to see if something is on the list.

(cherry picked from commit 84572eb25b1204a8832d83d99df67a7d4f5e155d)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: LC_NUMERIC manip requires a decl
Karl Williamson [Sat, 29 Jun 2019 17:24:56 +0000 (11:24 -0600)]
parts/apicheck.pl: LC_NUMERIC manip requires a decl

The tests for these macros need to be special cased, like some others,
so that a declaration is made.

(cherry picked from commit eec0adf3b6947231b219e9d03dfaeeb9bebb2cb7)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Fix up aTHX
Karl Williamson [Tue, 25 Jun 2019 17:58:35 +0000 (11:58 -0600)]
parts/apicheck.pl: Fix up aTHX

Now that we have better flags indicating if a macro or function needs
thread context or not, we can do a better job of handling it.

(cherry picked from commit 26a7bc7c87b1326539c5ec9b6389e615051a066a)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Handle const parameters
Karl Williamson [Tue, 25 Jun 2019 17:46:33 +0000 (11:46 -0600)]
parts/apicheck.pl: Handle const parameters

We now have parameters that are declared 'const'.  The code generated
previously was declared const without being initialized, which is now
fatal.

(cherry picked from commit 35286f38df4517fb5fa338fcff410eaa5c0ddce0)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: Handle identifier containing 'const'
Karl Williamson [Tue, 25 Jun 2019 17:35:51 +0000 (11:35 -0600)]
parts/apicheck.pl: Handle identifier containing 'const'

While reading the code, I realized that if an identifier name contained
the substring 'const' this wouldn't work.  It's a simple matter to add
\b to prevent this unlikely scenario.

(cherry picked from commit eaa9c034d31c5a167bf85b6888fed5201bf0667f)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apicheck.pl: ignore duplicate function
Karl Williamson [Sat, 20 Jul 2019 21:01:59 +0000 (15:01 -0600)]
parts/apicheck.pl: ignore duplicate function

(cherry picked from commit 9dfb2a45f3db2125b67e3f6b9783e10a129dab57)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/ppptools.pl: Misspelled intended lookbehind assertion
Karl Williamson [Wed, 14 Aug 2019 22:28:33 +0000 (16:28 -0600)]
parts/ppptools.pl: Misspelled intended lookbehind assertion

And when I corrected the spelling, I discovered that it would never have
worked if spelled correctly on perls that predate this feature.  So I
used a less efficient loop.

(cherry picked from commit e1584b7d3806e80c64225acc2dd0e4b0ee45196e)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/ppptools.pl: Add comments, white-space, m//x
Karl Williamson [Mon, 15 Jul 2019 21:35:14 +0000 (15:35 -0600)]
parts/ppptools.pl: Add comments, white-space, m//x

This makes some patterns /x with white space to make them more readable.
It also changes several s/\s*// to s/\s+//, which is faster.

(cherry picked from commit 49ee9fdc8f67a4180bee01519cba8bce36f33387)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/ppptools.pl: Rename variables
Karl Williamson [Thu, 18 Jul 2019 20:50:00 +0000 (14:50 -0600)]
parts/ppptools.pl: Rename variables

to be more mnemonic

(cherry picked from commit dd19dfc1234756d5bc4e21e49a7e0e1a47924f96)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/ppptools.pl: Normalize prototypes
Karl Williamson [Fri, 12 Jul 2019 16:38:10 +0000 (10:38 -0600)]
parts/ppptools.pl: Normalize prototypes

This is so the existing comparison routines don't show that things are
different solely because of white space differences

(cherry picked from commit 93e8c96d2cd21f17b16636c3876a7960ef48b74e)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/ppptools.pl: Yet another instance of an old flag
Karl Williamson [Thu, 11 Jul 2019 04:32:55 +0000 (22:32 -0600)]
parts/ppptools.pl: Yet another instance of an old flag

THe meanings of various flags changed a couple of months ago.  This is
the final (AFAICT) one to update.

(cherry picked from commit f03de555ac51a65231b9116f35506a751f5d559b)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/ppptools.pl: Don't omit any fcns/macros in parsing .fnc
Karl Williamson [Tue, 9 Jul 2019 17:47:47 +0000 (11:47 -0600)]
parts/ppptools.pl: Don't omit any fcns/macros in parsing .fnc

A commit I made some years ago caused deprecated and experimental
functions from not being parsed.  This was the wrong thing to do.
This is because some tools like scan_prov (which hasn't been run in many
years) need them.  Instead this moves the skipping to the routine that
needs to skip, and doesn't skip as many categories.

(cherry picked from commit 24f05e758aa2d50ac85aa495b956b209e52a5e84)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoapicheck_c.PL: Add detail to comment
Karl Williamson [Wed, 14 Aug 2019 13:20:40 +0000 (07:20 -0600)]
apicheck_c.PL: Add detail to comment

(cherry picked from commit 948b1be3996812d97c85115a7c35678a0ab2b596)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agodevel/mkapidoc.sh: Add strict, warnings
Karl Williamson [Wed, 14 Aug 2019 23:39:10 +0000 (17:39 -0600)]
devel/mkapidoc.sh: Add strict, warnings

(cherry picked from commit 5b5e4dc3f866089d8a51f580d4ecb554452a816a)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoAll entries in apidoc.fnc are documented
Karl Williamson [Thu, 4 Jul 2019 20:25:29 +0000 (14:25 -0600)]
All entries in apidoc.fnc are documented

They often don't have that flag in the source, but since they're in the
source, they're documented.  So just add the flag when generating the
file.

(cherry picked from commit 78cf0bdd4bbf969d6ec7058755320706aff9143e)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agodevel/mkapidoc.sh: Slight clean up
Karl Williamson [Tue, 6 Aug 2019 04:54:32 +0000 (22:54 -0600)]
devel/mkapidoc.sh: Slight clean up

(cherry picked from commit 3135597a40b0d2fdc6daaa57cedd88b6963b58ff)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agodevel/mkapidoc.sh: Sort the apidoc macros by name
Karl Williamson [Tue, 25 Jun 2019 17:19:18 +0000 (11:19 -0600)]
devel/mkapidoc.sh: Sort the apidoc macros by name

(cherry picked from commit ba3cdff1750f4339cf04e511c9ac9099c93d10a4)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agodevel/mkapidoc.sh: White-space, comments only
Karl Williamson [Tue, 25 Jun 2019 17:09:58 +0000 (11:09 -0600)]
devel/mkapidoc.sh: White-space, comments only

This makes it more readable

(cherry picked from commit 9b98f505fc1548b82871f2870b10282bcdc489d2)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agodevel/mkapidoc.sh: Skip irrelevant embed.fnc lines
Karl Williamson [Thu, 8 Aug 2019 18:33:18 +0000 (12:33 -0600)]
devel/mkapidoc.sh: Skip irrelevant embed.fnc lines

Skip comments, for example.

(cherry picked from commit a71d41a14e304380acebac8be29cba06b6e5d137)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/apidoc.fnc: Update to latest blead
Karl Williamson [Sun, 15 Sep 2019 00:05:15 +0000 (18:05 -0600)]
parts/apidoc.fnc: Update to latest blead

(cherry picked from commit 7a3ddf4b0ce4331d84b33ea64c6c33e22df6c51b)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoUpdate to latest blead embed.fnc
Karl Williamson [Sat, 14 Sep 2019 21:09:24 +0000 (15:09 -0600)]
Update to latest blead embed.fnc

(cherry picked from commit c788af012154f2734511c5b7f6f0a9be18de78e7)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/inc/utf8: Don't use postfix for in D:P tests
Karl Williamson [Sun, 15 Sep 2019 16:21:06 +0000 (10:21 -0600)]
parts/inc/utf8: Don't use postfix for in D:P tests

Devel::PPPort goes back further than this construct.
(cherry picked from commit f5c4f171dfbd4ead0b9a9dd191c9709f9fedcbd5)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoparts/inc/utf8: blead still doesn't work
Karl Williamson [Tue, 20 Aug 2019 01:29:29 +0000 (19:29 -0600)]
parts/inc/utf8: blead still doesn't work

This was a commit that was made in blead, and needs to be copied to the
distro.  The release at which blead will start working without being
overridden by ppport.h had to be delayed one month.

(cherry picked from commit 7b671cf31e5d22e692481b72066c2624b7cbf823)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoImplement sv_len_utf8_nomg() and sv_len_utf8()
Pali [Tue, 27 Aug 2019 11:44:35 +0000 (13:44 +0200)]
Implement sv_len_utf8_nomg() and sv_len_utf8()

Also fix sv_len_utf8() for Perl versions prior to 5.17.5.

(cherry picked from commit 91ea0ce8f1d77f9ba270b19eb01ed94cb349b7b3)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoHACKERS: Add info about Hints and Warnings
Karl Williamson [Thu, 4 Jul 2019 20:19:42 +0000 (14:19 -0600)]
HACKERS: Add info about Hints and Warnings

(cherry picked from commit 51b0c694ca09fb4656215cbe4575b9654a63a522)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoImplement SvIV_nomg(), SvUV_nomg(), SvNV_nomg() and SvTRUE_nomg()
Pali [Fri, 12 Jul 2019 11:37:06 +0000 (13:37 +0200)]
Implement SvIV_nomg(), SvUV_nomg(), SvNV_nomg() and SvTRUE_nomg()

Use sv_mortalcopy_flags() macro with SV_NOSTEAL flag to create non-magical
copy of input scalar. And on this non-magical copy call original Perl's
SvIV/SvUV/SvNV/SvTRUE macro.

This would ensure that get magic is not processed on original input scalar
argument and also that correct value is returned.

(cherry picked from commit c01919df38e1d016f008b3572c81a86f70e53be5)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoFix eval_pv for Perl versions prior to 5.31.2
Pali [Tue, 9 Jul 2019 10:18:09 +0000 (12:18 +0200)]
Fix eval_pv for Perl versions prior to 5.31.2

Seems that check for SvROK() and SvTRUE() is enough, see:
https://rt.perl.org/Public/Bug/Display.html?id=134177
https://rt.perl.org/Public/Bug/Display.html?id=134175

(cherry picked from commit 0f5184e818b7217c9a75d5275b716a055f7bef6c)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoBackport PL_mess_sv
Karl Williamson [Mon, 8 Jul 2019 22:04:23 +0000 (16:04 -0600)]
Backport PL_mess_sv

(cherry picked from commit 8f700bf9c63f435025a5d92bfd424c1312b9bc3d)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoBackport foldEQ_utf8 using ibcmp_utf8
Karl Williamson [Thu, 4 Jul 2019 18:21:16 +0000 (12:21 -0600)]
Backport foldEQ_utf8 using ibcmp_utf8

Though I think there were some bugs in earlier versions.

(cherry picked from commit 53fcb552d031c2a48d34ce24e9f213f5167ce05a)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoBackport is_utf8_invariant_string, is_invariant_string
Karl Williamson [Thu, 4 Jul 2019 19:15:21 +0000 (13:15 -0600)]
Backport is_utf8_invariant_string, is_invariant_string

These are more correct synonyms for is_ascii_string

(cherry picked from commit 7d9499b7ae83f2017b5c3a659547d98dc11633eb)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoBackport BOM_UTF8 REPLACEMENT_CHARACTER_UTF8
Karl Williamson [Thu, 4 Jul 2019 18:19:10 +0000 (12:19 -0600)]
Backport BOM_UTF8 REPLACEMENT_CHARACTER_UTF8

(cherry picked from commit 95c5c8d34cb28d3774aac13153a03ae61673bd82)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoBackport isUTF8_CHAR
Karl Williamson [Thu, 4 Jul 2019 18:14:56 +0000 (12:14 -0600)]
Backport isUTF8_CHAR

(cherry picked from commit 9ef04c4cd59fdfe1f76083ad76803544d38a9012)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoConsolidate UTF-8 functions/macros into new file
Karl Williamson [Thu, 4 Jul 2019 18:05:32 +0000 (12:05 -0600)]
Consolidate UTF-8 functions/macros into new file

It's easier to grok when these are all together, and not in several
files.

(cherry picked from commit 365c133b9378a47cbf5ccf78a6dfc713cb8388de)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoImplement sv_mortalcopy_flags()
Pali [Thu, 4 Jul 2019 15:05:34 +0000 (17:05 +0200)]
Implement sv_mortalcopy_flags()

(cherry picked from commit a8ddf81bea0c2c5a7476a76c98b307764f69bee5)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoImplement newSVsv_flags()
Pali [Thu, 4 Jul 2019 10:01:59 +0000 (12:01 +0200)]
Implement newSVsv_flags()

(cherry picked from commit d1ffac9ac663e9293129c76289d5bb8124566060)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoAdd tests for IVdf, UVuf, IV_MAX and UV_MAX
Pali [Mon, 1 Jul 2019 12:37:19 +0000 (14:37 +0200)]
Add tests for IVdf, UVuf, IV_MAX and UV_MAX

(cherry picked from commit 2b31db974097bbec6a64078e2a3f8c1c166236ad)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoFix several other implemented todo
Nicolas R [Thu, 16 May 2019 21:58:36 +0000 (15:58 -0600)]
Fix several other implemented todo

Fixes GH #61 aka RT 134101

(cherry picked from commit 92ceda883e0bc1fc9a093bb0af07d04e81dc01ab)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoEnable Perl compile-time warnings at all places
Pali [Mon, 1 Jul 2019 20:54:13 +0000 (22:54 +0200)]
Enable Perl compile-time warnings at all places

(cherry picked from commit aad9feda2ec7fa8b44924162ed852de4ea074ab4)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoMakefile.PL: Fix so works on early perls
Karl Williamson [Tue, 9 Jul 2019 17:40:50 +0000 (11:40 -0600)]
Makefile.PL: Fix so works on early perls

You can't declare a variable within a looping statement like 'for' in
early perls.  Just declare it immediately beforehand.

(cherry picked from commit 1b3fbf992bcf862b418afbd705ce1d1eb0c573fb)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoAdd required dependency for $(VERSION_FROM) target in Makefile.PL
Pali [Sun, 2 Jun 2019 11:34:45 +0000 (13:34 +0200)]
Add required dependency for $(VERSION_FROM) target in Makefile.PL

(cherry picked from commit 4b59ba9792a43a0891ad07adff7b15b11b239649)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoUse correct method for checking module version in Makefile.PL
Pali [Sun, 2 Jun 2019 11:34:33 +0000 (13:34 +0200)]
Use correct method for checking module version in Makefile.PL

(cherry picked from commit 45499778ea5ff8fbb51a5e75059b3c94e221f9e6)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoFix inclusion of META_MERGE in Makefile.PL
Pali [Sun, 2 Jun 2019 11:34:26 +0000 (13:34 +0200)]
Fix inclusion of META_MERGE in Makefile.PL

(cherry picked from commit a145a59bef4ca21685181c0b912d9c7218e0742d)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoEnable warnings in Makefile.PL
Pali [Sun, 2 Jun 2019 11:34:14 +0000 (13:34 +0200)]
Enable warnings in Makefile.PL

(cherry picked from commit f74454f179348ed4aebc04ba735ccc12eee3c980)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoUpdate HACKERS
Karl Williamson [Sun, 21 Jul 2019 00:25:23 +0000 (18:25 -0600)]
Update HACKERS

(cherry picked from commit faa4c9817e61fd8aa4c1d18877c2c5800bf113b6)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoHACKERS: Update
Karl Williamson [Wed, 10 Jul 2019 03:53:12 +0000 (21:53 -0600)]
HACKERS: Update

(cherry picked from commit ac27a862173e52405c4f93657cd350ad9312ec24)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoHACKERS: Add info about Hints and Warnings
Karl Williamson [Thu, 4 Jul 2019 20:19:42 +0000 (14:19 -0600)]
HACKERS: Add info about Hints and Warnings

(cherry picked from commit 5df9c36cef7b172a0fe805f209de55cbb87f6ac6)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoDocument D_PPP_ prefix for macros
Pali [Mon, 17 Jun 2019 13:54:13 +0000 (15:54 +0200)]
Document D_PPP_ prefix for macros

(cherry picked from commit 7556987e03558cd2f200df996ee222da58e5889c)
Signed-off-by: Nicolas R <atoomic@cpan.org>
3 years agoregcomp.h: Parenthesize param in macro expansion
Karl Williamson [Sat, 21 Sep 2019 19:18:12 +0000 (13:18 -0600)]
regcomp.h: Parenthesize param in macro expansion

This is always a good idea

3 years agoregcomp.h: Remove duplicate macro expansion
Karl Williamson [Sat, 21 Sep 2019 19:14:25 +0000 (13:14 -0600)]
regcomp.h: Remove duplicate macro expansion

This macro has the same definition as another.

3 years agoregcomp.c: Clarify some comments
Karl Williamson [Fri, 27 Sep 2019 04:09:51 +0000 (22:09 -0600)]
regcomp.c: Clarify some comments

3 years agoregcomp.sym Update and improve descriptions of some nodes
Karl Williamson [Sun, 22 Sep 2019 21:09:05 +0000 (15:09 -0600)]
regcomp.sym Update and improve descriptions of some nodes

EXACTFU nodes always now fold their strings; the information here had
not been updated to reflect that change.

And the descriptions of several EXACTish nodes are now changed to be
slightly shorter and to remove mention of the string length, which is
problematic, and is covered in the description for EXACT

3 years agoregen/regcomp.pl: Rename variable
Karl Williamson [Thu, 26 Sep 2019 22:30:21 +0000 (16:30 -0600)]
regen/regcomp.pl: Rename variable

The old name was misleading.

3 years agoregen/regcomp.pl, regcomp.sym: Comments
Karl Williamson [Thu, 26 Sep 2019 22:23:33 +0000 (16:23 -0600)]
regen/regcomp.pl, regcomp.sym: Comments

I spent some time in this code trying to understand some things, and as
a result I'm commenting previously undocumented features.  The comments
about what an entry in regcomp.sym should look like are moved to that
file, rather than the file that reads it.  The former is most often
touched, and they had gotten out-of-sync in the latter.  Things now make
more sense to me, and hopefully anyone using this in the future.

3 years agoSilence verbatim line pod warning in perldebguts
Karl Williamson [Fri, 27 Sep 2019 02:49:53 +0000 (20:49 -0600)]
Silence verbatim line pod warning in perldebguts

This generated pod has many lines that really can't be wrapped.  So
change the podcheck.t db to ignore these errors in this file.

3 years agoAdd note to debugging output if regex already compiled
Karl Williamson [Thu, 26 Sep 2019 19:14:14 +0000 (13:14 -0600)]
Add note to debugging output if regex already compiled

Prior to this commit, the debugging output says "Compiling REx foo".
But there was no indication that it was skipped due to the pattern
already being compiled; so that was confusing to people, and was a Stack
Overflow question of what is going on.  Now there's an extra message
that the recompilation is skipped.

3 years agoperlrun: Note that -W can't be in PERL5OPT
Karl Williamson [Sun, 22 Sep 2019 21:48:51 +0000 (15:48 -0600)]
perlrun: Note that -W can't be in PERL5OPT

3 years agohandy.h: Avoid compiler warnings for withinCOUNT()
Karl Williamson [Thu, 26 Sep 2019 04:23:55 +0000 (22:23 -0600)]
handy.h: Avoid compiler warnings for withinCOUNT()

If a parameter to this function is unsigned, gcc, at least, generates a
comparison-always-true warning for the asserts on the parameters.
Silence these by casting to an NV.  Any extra machine instructions will
be gone from non-DEBUGGING builds.  The value in an NV won't necessarily
be exact, but all the assertions care about is the sign, which is
guaranteed by C11 standard 6.3.1.4 item 2.

This technique was the idea of Tomasz Konojacki.

3 years agohandy.h: Rmv duplicated assert in inRANGE()
Karl Williamson [Sat, 21 Sep 2019 18:23:49 +0000 (12:23 -0600)]
handy.h: Rmv duplicated assert in inRANGE()

This assertion is done in the macro that is called to do the real work.

3 years agohandy.h Fix withinCOUNT() for > 32 bit operands
Karl Williamson [Mon, 9 Sep 2019 20:57:07 +0000 (14:57 -0600)]
handy.h Fix withinCOUNT() for > 32 bit operands

It needs to cast to unsigned in all circumstances; prior to this commit
it failed to do so for oprands wider than 32 bits

3 years ago[MERGE] little fixups to signature tweaks
David Mitchell [Wed, 25 Sep 2019 20:51:50 +0000 (21:51 +0100)]
[MERGE] little fixups to signature tweaks

v5.31.4-18-g9fb6174d08 tweaked a few signature-related things but
introduced a leak in the test suite and left some debugging code in.

3 years agofix leak in APItest.xs
David Mitchell [Wed, 25 Sep 2019 20:46:47 +0000 (21:46 +0100)]
fix leak in APItest.xs

The leak Was introduced by my recent commit v5.31.4-16-g4df857782a,
which added an extra op at the head of a signature subtree, but which
wasn't being freed by the code in the parse_subsignature test.

3 years agoPerl_Slab_Alloc(): tweak logging
David Mitchell [Wed, 25 Sep 2019 17:34:09 +0000 (18:34 +0100)]
Perl_Slab_Alloc(): tweak logging

When looking for a suitable op-sized chunk of memory in a slab's free
list, perl logs the search but doesn't log a successful match. Add such
a log line to make analysis of the output of 'perl -DS' easier.

3 years agoXS-APItest/t/subsignature.t: remove debugging code
David Mitchell [Tue, 24 Sep 2019 12:45:20 +0000 (13:45 +0100)]
XS-APItest/t/subsignature.t: remove debugging code

I accidentally left a temporary Data::Dumper line in it.

3 years agot/lib/charnames/alias: Fix typo in comment
Karl Williamson [Fri, 30 Aug 2019 17:11:47 +0000 (11:11 -0600)]
t/lib/charnames/alias: Fix typo in comment

3 years agoutil.c: Missing semicolon with rarely used compile ops
Karl Williamson [Tue, 3 Sep 2019 15:46:28 +0000 (09:46 -0600)]
util.c: Missing semicolon with rarely used compile ops

3 years agot/harness: Clarify error message wording
Karl Williamson [Tue, 3 Sep 2019 15:34:47 +0000 (09:34 -0600)]
t/harness: Clarify error message wording

3 years ago[MERGE] assorted su signature tweaks
David Mitchell [Mon, 23 Sep 2019 15:20:37 +0000 (16:20 +0100)]
[MERGE] assorted su signature tweaks

Apply several small fixes to the subroutine signatures implementation,
in preparation for major improvements to the syntax likely to happen
soon.

Nothing here changes the signatures syntax.

3 years agosub foo($_) {...} - change error message
David Mitchell [Mon, 23 Sep 2019 14:22:11 +0000 (15:22 +0100)]
sub foo($_) {...}  - change error message

When using one of the globals like $_ or @_ in a subroutine signature,
the error message was misleading:

    Can't use global $_ in "my"

This commit changes it to:

    Can't use global $_ in subroutine signature

3 years agoput signature ops in their own subtree.
David Mitchell [Fri, 20 Sep 2019 13:43:01 +0000 (14:43 +0100)]
put signature ops in their own subtree.

The following code:

    sub f ($x,$y) {
        study;
    }

used to compile as:

    a  <1> leavesub[1 ref] K/REFC,1 ->(end)
    -     <@> lineseq KP ->a
    1        <;> nextstate(main 5 p:5) v:%,fea=7 ->2
    2        <+> argcheck(2,0) v ->3
    3        <;> nextstate(main 3 p:5) v:%,fea=7 ->4
    4        <+> argelem(0)[$x:3,5] v/SV ->5
    5        <;> nextstate(main 4 p:5) v:%,fea=7 ->6
    6        <+> argelem(1)[$y:4,5] v/SV ->7
    -        <;> ex-nextstate(main 5 p:5) v:%,fea=7 ->7
    7        <;> nextstate(main 5 p:6) v:%,fea=7 ->8
    9        <1> study sK/1 ->a
    -           <1> ex-rv2sv sK/1 ->9
    8              <$> gvsv(*_) s ->9

Following this commit, it compiles as:

    a  <1> leavesub[1 ref] K/REFC,1 ->(end)
    -     <@> lineseq KP ->a
    -        <1> ex-argcheck vK/1 ->7
    -           <@> lineseq vK ->-
    1              <;> nextstate(main 5 p:5) v:%,fea=7 ->2
    2              <+> argcheck(2,0) v ->3
    3              <;> nextstate(main 3 p:5) v:%,fea=7 ->4
    4              <+> argelem(0)[$x:3,5] v/SV ->5
    5              <;> nextstate(main 4 p:5) v:%,fea=7 ->6
    6              <+> argelem(1)[$y:4,5] v/SV ->7
    -              <;> ex-nextstate(main 5 p:5) v:%,fea=7 ->-
    7        <;> nextstate(main 5 p:6) v:%,fea=7 ->8
    9        <1> study sK/1 ->a
    -           <1> ex-rv2sv sK/1 ->9
    8              <#> gvsv[*_] s ->9

All the ops associated with the signature have been put in their own
subtree, with an extra NULL ex-argcheck op "on top". The op on top
serves two purposes: first, it makes it easier for Deparse.pm etc to
spot siganure code; secondly, it may at some point in the future be
upgraded to OP_SIGNATURE when signatures get optimised. It's of type
ex-argcheck only because when being created it needs to be an op type
that's in class UNOP_AUX so that the created op will be suitable for
later optimising, and making it an ex-type associated with signatures
helps flag it as such.

There should be no functional changes apart from the shape of the
optree.

3 years agorpeep(): skip duplicate nextstates even with gaps
David Mitchell [Sat, 21 Sep 2019 11:24:45 +0000 (12:24 +0100)]
rpeep(): skip duplicate nextstates even with gaps

rpeep() already optimises away consecutive nextstate ops. This commit
makes it do this even if there are 'noop' ops between them like null,
scope, lineseq.

This has a specific utility for the next commit, which will reorganise
the optree for subroutine signatures in a way which introduces a lineseq
between two nextstates.

3 years agoSignatures: change param count from IV to UV
David Mitchell [Fri, 20 Sep 2019 10:11:36 +0000 (11:11 +0100)]
Signatures: change param count from IV to UV

For some reason I was storing the counts of sub signature parameters and
optional parameters as signed ints. Since these can never be negative,
change them to UV instead.