This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
4 years agoembed.fnc: Fix comments
Karl Williamson [Thu, 27 Feb 2020 15:13:51 +0000 (08:13 -0700)]
embed.fnc: Fix comments

4 years agoembed.fnc: Make re_croak a format fcn
Karl Williamson [Thu, 27 Feb 2020 14:56:17 +0000 (07:56 -0700)]
embed.fnc: Make re_croak a format fcn

This enables compiler warnings when argument types don't match the
format

4 years agoregcomp.c: Change re_croak2 to re_croak
Karl Williamson [Thu, 27 Feb 2020 14:48:07 +0000 (07:48 -0700)]
regcomp.c: Change re_croak2 to re_croak

This changes this function from taking two format parameters to instead
taking a single one.  The reason is that the generality isn't actually
currently needed, and it prevents the function from being declared as
taking a format, which adds extra checking.  If this checking had been
in effect, GH #17574 would have generated a warning message.

The reason the second format isn't required is that in all cases, both
formats are literal strings.  In the macros that call this, simply
removing the comma separators between them causes the two literals to
automagically become one by the C preprocessor.

4 years agoAdd epigraph for 5.30.2-RC1
Steve Hay [Sat, 29 Feb 2020 19:37:49 +0000 (19:37 +0000)]
Add epigraph for 5.30.2-RC1

4 years agoregcomp.c -reorder RExC_state_t to close x86-64 alignment holes
Richard Leach [Mon, 24 Feb 2020 23:51:08 +0000 (23:51 +0000)]
regcomp.c -reorder RExC_state_t to close x86-64 alignment holes

4 years agoregcomp.c: Remove never used struct element
Karl Williamson [Sat, 29 Feb 2020 16:02:15 +0000 (09:02 -0700)]
regcomp.c: Remove never used struct element

Noted in
https://github.com/Perl/perl5/pull/17580#issuecomment-592957998
this #define has never been set, and the element hence has never been
used.

4 years ago5.30.2-RC1 today
Steve Hay [Sat, 29 Feb 2020 12:20:58 +0000 (12:20 +0000)]
5.30.2-RC1 today

4 years agoMention perlbug emails in issue template
Dan Book [Fri, 28 Feb 2020 23:48:46 +0000 (18:48 -0500)]
Mention perlbug emails in issue template

4 years agoperlguts.pod: fix typo when describing scope stack
Richard Leach [Wed, 26 Feb 2020 00:10:16 +0000 (00:10 +0000)]
perlguts.pod: fix typo when describing scope stack

4 years agoperl.h: Add comment, reorder conditional branches
Karl Williamson [Mon, 24 Feb 2020 20:52:20 +0000 (13:52 -0700)]
perl.h: Add comment, reorder conditional branches

This clarifies things a bit

4 years agore_intuit_string: fix to work with empty pattern
Karl Williamson [Mon, 24 Feb 2020 20:50:12 +0000 (13:50 -0700)]
re_intuit_string: fix to work with empty pattern

This would fail should it ever be called with a pattern that only
matched nothing.

4 years agoregcomp.c: Add some comments
Karl Williamson [Thu, 20 Feb 2020 22:39:52 +0000 (15:39 -0700)]
regcomp.c: Add some comments

4 years agoRevert "Test 32bit Perl build on Travis"
Karl Williamson [Thu, 27 Feb 2020 16:03:45 +0000 (09:03 -0700)]
Revert "Test 32bit Perl build on Travis"

This reverts commit 83067d4902203c0bd0a6e901cd25f3b871668331.

4 years agobump $Storable::VERSION and update ChangeLog
Tony Cook [Wed, 26 Feb 2020 23:40:46 +0000 (10:40 +1100)]
bump $Storable::VERSION and update ChangeLog

4 years agoStorable: fix a format string vs argument error
Tony Cook [Wed, 26 Feb 2020 23:40:26 +0000 (10:40 +1100)]
Storable: fix a format string vs argument error

4 years agoPATCH: #17574 reg_mesg.t failures on 32-bit builds
Karl Williamson [Wed, 26 Feb 2020 17:48:03 +0000 (10:48 -0700)]
PATCH: #17574 reg_mesg.t failures on 32-bit builds

This turned out to be because I was printing a UV with %c.

4 years agoregcomp.h: Use pre-existing macro to hide variable
Karl Williamson [Wed, 26 Feb 2020 16:01:20 +0000 (09:01 -0700)]
regcomp.h: Use pre-existing macro to hide variable

Instead of repeating this variable name all over the place, use the
macro that had been created to refer to it.

4 years agoregexec.c: Fix Debug statement
Karl Williamson [Tue, 25 Feb 2020 04:11:56 +0000 (21:11 -0700)]
regexec.c: Fix Debug statement

A proper debugging statement isn't just controlled by DEBUG_r, it needs
what sort of class of debugging controls this, so that re.pm can operate
properly.

This is the second of two cases in the code where it was wrong.

4 years agoregexec.c: Fix Debug statement
Karl Williamson [Tue, 25 Feb 2020 04:09:29 +0000 (21:09 -0700)]
regexec.c: Fix Debug statement

A proper debugging statement isn't just controlled by DEBUG_r, it needs
what sort of class of debugging controls this, so that re.pm can operate
properly.

This is one of two cases in the code where it was wrong.

4 years agoTest 32bit Perl build on Travis
Pali [Thu, 5 Dec 2019 11:58:12 +0000 (12:58 +0100)]
Test 32bit Perl build on Travis

4 years agofix VC perlglob.exe segv with wrong default libc
Daniel Dragan [Mon, 17 Feb 2020 01:57:46 +0000 (20:57 -0500)]
fix VC perlglob.exe segv with wrong default libc

commit "win32: separate $Config{ccflags} and $Config{optimize}"
4be1bfd74 removed -Md and -MDd from $(OPTIMIZE), so perlglob.exe whose
build recipe is special in that it is compiled and linked in 1 step lost
the -Md flag, this causes "stdout" global var that is linked in from MSVC
libc to resolve to a broken symbol and segv since the FILE * is a pointer
to machine code instead to a FILE struct in the CRT DLL. This is with MSVC
2003 32b CC.

Disassembly shows that after that commit perlglob.exe is
push    8000h
mov     edi, offset __imp____getmainargs
push    edi             ; File
call    _fileno_0

which is a pointer to machine code instead of

mov     eax, ds:__imp___iob
add     eax, 20h
push    8000h           ; int
push    eax             ; File
call    ds:__imp___fileno

where _iob is a pointer to start of static global array of FH structs in
MS CRT.

-Md controls ".drectve" section in .obj file that contains
"/DEFAULTLIB:"MSVCRT"" (proper) or "/DEFAULTLIB:"LIBC"" (SEGV)

crash stack
ntdll.dll!_RtlpWaitForCriticalSection@4
ntdll.dll!_RtlEnterCriticalSection@4
msvcr71.dll!_lock_file
msvcr71.dll!fwrite
perlglob.exe!main
perlglob.exe!mainCRTStartup
kernel32.dll!_BaseProcessStart@4

The CS struct is gibberish because the FILE * is gibberish.

4 years agocorrect starting version for isa feature
Karen Etheridge [Sat, 22 Feb 2020 21:25:17 +0000 (13:25 -0800)]
correct starting version for isa feature

This was added in commit 813e85a03d, which first appeared in the 5.31.7 release.

4 years agopunctuation
Karen Etheridge [Sat, 22 Feb 2020 20:26:44 +0000 (12:26 -0800)]
punctuation

4 years agolinkify GH links in last delta
Karen Etheridge [Sat, 22 Feb 2020 20:24:28 +0000 (12:24 -0800)]
linkify GH links in last delta

4 years agominor grammar fixes
Karen Etheridge [Sat, 22 Feb 2020 20:23:06 +0000 (12:23 -0800)]
minor grammar fixes

4 years agoIncrease required macro-space for HP-UX C-ANSI-C
H.Merijn Brand [Sat, 22 Feb 2020 11:26:21 +0000 (12:26 +0100)]
Increase required macro-space for HP-UX C-ANSI-C

125000 was too small!

4 years agoHP-UX 11.11 and below do not have wcrtomb
H.Merijn Brand [Sat, 22 Feb 2020 10:57:43 +0000 (11:57 +0100)]
HP-UX 11.11 and below do not have wcrtomb

At least not with HP C-ANSI-C, but as mbrlen and mbrtowc are already
disabled, it is in kine with expectation.

This makes perl compilable again on 11.11 with HP C-ANSI-C

4 years agoShim update of Module::CoreList for v5.31.10
Chris 'BinGOs' Williams [Fri, 21 Feb 2020 15:25:01 +0000 (15:25 +0000)]
Shim update of Module::CoreList for v5.31.10

4 years agoCoal fire crackdown
Chris 'BinGOs' Williams [Fri, 21 Feb 2020 09:19:14 +0000 (09:19 +0000)]
Coal fire crackdown

4 years agoBump the perl version in various places for 5.31.10
reneeb [Fri, 21 Feb 2020 01:03:02 +0000 (02:03 +0100)]
Bump the perl version in various places for 5.31.10

4 years agogenerated new perldelta after 5.31.9 release
reneeb [Fri, 21 Feb 2020 00:11:01 +0000 (01:11 +0100)]
generated new perldelta after 5.31.9 release

4 years agotick release 5.31.9 in release schedule
reneeb [Fri, 21 Feb 2020 00:04:41 +0000 (01:04 +0100)]
tick release 5.31.9 in release schedule

4 years agoadd epigraph of 5.31.9
reneeb [Thu, 20 Feb 2020 23:54:44 +0000 (00:54 +0100)]
add epigraph of 5.31.9

4 years agoMerge branch 'release-5.31.9' into blead
reneeb [Thu, 20 Feb 2020 23:47:55 +0000 (00:47 +0100)]
Merge branch 'release-5.31.9' into blead

4 years agoregcomp.c: Silence compiler warning
Karl Williamson [Thu, 20 Feb 2020 17:44:55 +0000 (10:44 -0700)]
regcomp.c: Silence compiler warning

This parameter is unused except under certain debugging compile options

Spotted by James Keenan

4 years ago.mailmap should be excluded from the MANIFEST cross checking during release v5.31.9
reneeb [Thu, 20 Feb 2020 15:41:17 +0000 (16:41 +0100)]
.mailmap should be excluded from the MANIFEST cross checking during release

4 years ago.mailmap should not be in MANIFEST, so exclude that file in Porting/manicheck
reneeb [Thu, 20 Feb 2020 15:35:26 +0000 (16:35 +0100)]
.mailmap  should not be in MANIFEST, so exclude that file in Porting/manicheck

4 years agoadd new release to perlhist
reneeb [Thu, 20 Feb 2020 14:47:36 +0000 (15:47 +0100)]
add new release to perlhist

4 years agofinalize perldelta
reneeb [Thu, 20 Feb 2020 14:43:59 +0000 (15:43 +0100)]
finalize perldelta

4 years agoUpdate Module::CoreList for 5.31.9
reneeb [Thu, 20 Feb 2020 14:42:37 +0000 (15:42 +0100)]
Update Module::CoreList for 5.31.9

4 years agofinalize perldelta
reneeb [Thu, 20 Feb 2020 13:51:36 +0000 (14:51 +0100)]
finalize perldelta

4 years agoFixup POSIX::mbtowc, wctomb
Karl Williamson [Sat, 4 Jan 2020 05:18:02 +0000 (22:18 -0700)]
Fixup POSIX::mbtowc, wctomb

This commit enhances these functions so that on threaded perls, they use
mbrtowc and wcrtomb when available, making them thread safe.  The
substitution isn't completely transparent, as no effort is made to hide
any differences in errno setting upon error.  And there may be slight
differences in edge case behavior on some platforms.

This commit also changes the behaviors so that they take a scalar
parameter instead of a char *, and this might be 'undef' or not be
forceable into a valid PV.  If not a PV, the functions initialize the
shift state.  Previously the shift state was always reinitialized with
every call, which meant these could not work on locales with shift
states.

In addition, there were several issues in mbtowc and wctomb that this
commit fixes.

mbtowc and wctomb, when used, are now run with a semaphore.  This avoids
races if called at the same time in another thread.

The returned wide character from mbtowc() could well have been garbage.

The final parameter to mbtowc is now optional, as passing an SV allows
us to determine the length without the need for an extra parameter.  It
is now used only to restrict the parsing of the string to shorter than
the actual length.

wctomb would segfault if the string parameter was shared or hadn't
been pre-allocated with a string of sufficient length to hold the
result.

4 years agoPOSIX::mblen: Make length parameter optional
Karl Williamson [Sat, 4 Jan 2020 05:10:43 +0000 (22:10 -0700)]
POSIX::mblen: Make length parameter optional

Now that the typemap is an SV, we can access the length from that.

4 years agoPOSIX::mblen() Make thread-safe; allow shift state control
Karl Williamson [Sat, 4 Jan 2020 05:16:42 +0000 (22:16 -0700)]
POSIX::mblen() Make thread-safe; allow shift state control

This commit changes the behavior so that it takes a scalar parameter
instead of a char *, and thus might not be forceable into a valid PV.
When not a PV, the shift state is reinitialized, like calling mblen with
a NULL first parameter.  Previously the shift state was always
reinitialized with every call, which meant this could not work on
locales with shift states.

This commit also changes to use mbrlen() on threaded perls transparently
(mostly), when available, to achieve thread-safe operation.  It is not
completely transparent because mbrlen (under the very rare stateful
locales) returns a different value  when it's resetting the shift state.
It also may set errno differently upon errors, and no effort is made to
hide that difference.  Also mbrlen on some platforms can handle partial
characters.

[perl #133928] showed that someone was having trouble with shift states.

4 years agoRestrict features in wildcards
Karl Williamson [Sun, 16 Feb 2020 00:39:00 +0000 (17:39 -0700)]
Restrict features in wildcards

The algorithm for dealing with Unicode property wildcards is to wrap the
user-supplied pattern with /miaa.  We don't want the user to be able to
override the /m and /aa parts.  Modifiers that are only specifiable as a
modifier in a qr or similar op (like /gc) can't be included in things
like (?gc).  These normally incur a warning that they are ignored, but
the texts of those warnings are misleading when using wildcards, so I
chose to just make them illegal.  Of course that could be changed to
having custom useful warning texts, but I didn't think it was worth it.

I also chose to forbid recursion of using nested \p{}, just from fear
that it might lead to issues down the road, and it really isn't useful
for this limited universe of strings to match against.  Because
wildcards currently can't handle '}' inside them, only the single letter
\p,\P are valid anyway.

Similarly, I forbid the '*' quantifier to make it harder for the
constructed subpattern to take forever to make any progress and decide
to halt.  Again, using it would be overkill on the universe of possible
match strings.

4 years agoregcomp.c: Reorder cases in a switch
Karl Williamson [Thu, 13 Feb 2020 05:27:58 +0000 (22:27 -0700)]
regcomp.c: Reorder cases in a switch

This is for a future commit where one will have extra work to do before
falling through to the other.

4 years agoregcomp.c: Add wrappers for cmplng/xctng wildcard subpatterns
Karl Williamson [Thu, 13 Feb 2020 04:07:27 +0000 (21:07 -0700)]
regcomp.c: Add wrappers for cmplng/xctng wildcard subpatterns

This is in preparation for being called from more than one place.

It has the salubrious effect that the wrapping we do around the user's
supplied pattern is no longer visible in the Debug output of that
pattern.

4 years agoregcomp.c: Create wrapper fcn for re_op_compile
Karl Williamson [Thu, 13 Feb 2020 03:53:20 +0000 (20:53 -0700)]
regcomp.c: Create wrapper fcn for re_op_compile

This does the bulk of re_compile(), but is a private entry point,
meaning it takes an extra parameter, and a future commit will call it
from another place.

4 years agoop.h: Move some flag bits down
Karl Williamson [Wed, 12 Feb 2020 23:40:29 +0000 (16:40 -0700)]
op.h: Move some flag bits down

This is in preparation for adding a new flag bit at the end in a future
commit.  It could have been added in the unused space that the first of
these was moved to, but the new one is less important/used, so I thought
it best to come last.  The reason to use unused space is to preserve
binary compatibility with the bits, and we don't care about that at this
point in the development cycle.

4 years agoRegenerate charclass_invlists.h
Karl Williamson [Thu, 20 Feb 2020 04:36:33 +0000 (21:36 -0700)]
Regenerate charclass_invlists.h

There is something wrong with our mechanism to show if this out-of
-sync, because it didn't.  And it needed regenerating.  I will have to
look to understand the reason why.  Nor did any of the tests fail.  In
part, I see from looking at the diffs that there is a rule that is no
longer used.  But it also may be that the Unicode-supplied test are
misisng things.  Obviously one can't test every code point, but just a
representative sample, so some things may fall through the cracks.

4 years agoregcomp.c: Indent some nested # preprocessor directives
Karl Williamson [Tue, 18 Feb 2020 17:51:26 +0000 (10:51 -0700)]
regcomp.c: Indent some nested # preprocessor directives

This is so you can figure out what the scope of the outer one is

4 years agot/re/reg_mesg.t: Emit diagnostics on some more failing tests
Karl Williamson [Wed, 19 Feb 2020 16:47:16 +0000 (09:47 -0700)]
t/re/reg_mesg.t: Emit diagnostics on some more failing tests

4 years agoregcomp.c: Add missing save_re_context()
Karl Williamson [Thu, 20 Feb 2020 00:07:20 +0000 (17:07 -0700)]
regcomp.c: Add missing save_re_context()

I noticed by symmetry that this call is missing.  I don't think anyone
knows how to reliably reproduce the problem this causes under a race
with other threads.

4 years agolib/charnames.t: Move initialization line
Karl Williamson [Wed, 19 Feb 2020 18:06:23 +0000 (11:06 -0700)]
lib/charnames.t: Move initialization line

to a more intuitive spot in the file

4 years agoMove some obsolete UTF-8 handling fcns to mathoms
Karl Williamson [Sat, 15 Feb 2020 18:15:09 +0000 (11:15 -0700)]
Move some obsolete UTF-8 handling fcns to mathoms

Two of the functions are internal to the core; the third has long been
deprecated.

4 years agoregcomp.c: White space only
Karl Williamson [Mon, 17 Feb 2020 17:59:35 +0000 (10:59 -0700)]
regcomp.c: White space only

This is mostly indenting and reflowing text after a surrounding block
was added by the previous commit.

4 years agoregcomp.c: Only output warning about experimental once
Karl Williamson [Tue, 18 Feb 2020 02:25:04 +0000 (19:25 -0700)]
regcomp.c: Only output warning about experimental once

If someone uses an experimental construct, prior to this commit, they
would get a warning each time they used it in the same pattern.  This
commit causes the warning to be emitted once per pattern.

I didn't add tests, because this I didn't think it important enough to
spend the time.  The consequences of this breaking in the future are
minimal, and the constructs are temporary, likely to be removed next
release.

4 years agoImprove handling of nested qr/(?[...])/
Karl Williamson [Mon, 17 Feb 2020 19:07:07 +0000 (12:07 -0700)]
Improve handling of nested qr/(?[...])/

A set operations expression can contain a previously-compiled one
interpolated in.  Prior to this commit, some heuristics were employed
to verify it actually was such a thing, and not a sort of look-alike
that wasn't necessarily valid.  The heuristics actually forbade legal
ones.  I don't know of any illegal ones that were let through, but it is
certainly possible.  Also, the error/warning messages referred to the
heuristics, and were unhelpful at best.

The technique used instead in this commit is to return a regop only used
by this feature for any nested compilations.  This guarantees that the
caller can determine if the result is valid, and what that result is
without having to do any heuristics or inspecting any flags.  The
error/warning messages are changed to reflect this, and I believe are
now helpful.

This fixes the bugs in #16779
https://github.com/Perl/perl5/issues/16779#issuecomment-563987618

4 years agoregcomp.c: Fix comment
Karl Williamson [Mon, 17 Feb 2020 19:05:00 +0000 (12:05 -0700)]
regcomp.c: Fix comment

4 years agoregcomp.sym: Add new regnode type for (?[])
Karl Williamson [Mon, 17 Feb 2020 18:24:19 +0000 (11:24 -0700)]
regcomp.sym: Add new regnode type for (?[])

This new regnode is used to handle interpolated already-compiled regex
sets inside outer regex sets.

If it isn't present, it will mean that what appears to be a nested,
interpolated set really isn't.

I created a new regnode structure to hold a pointer.  This has to be
temporary as pointers can be invalidated.  I thought of just having a
regnode without a pointer as a marker, and using a parallel array to
store the data, rather than creating a whole new regnode structure for
just pointers, but parallel data structures can get out of sync, so this
seemed best.

This commit just sets up the regnode; a future commit will actually use
it.

4 years agoregcomp.c; ([?...]) are single char width
Karl Williamson [Fri, 24 Jan 2020 18:11:02 +0000 (11:11 -0700)]
regcomp.c; ([?...]) are single char width

A regex set compiles to something that has width of exactly one
character.  The change involved merely moving the setting of these flags
to before a return instead of after.

4 years agoUpdate to latest Unicode 13.0
Karl Williamson [Wed, 19 Feb 2020 22:22:19 +0000 (15:22 -0700)]
Update to latest Unicode 13.0

Unicode has made minor changes in its data files since I added the beta
versions to Perl 5.31.  These are still beta; the final release date is
March 10.  I thought it best to get the latest into Perl 5.31.9.

4 years agomktables: Handle versioning of non-UCD files
Karl Williamson [Wed, 19 Feb 2020 21:55:50 +0000 (14:55 -0700)]
mktables: Handle versioning of non-UCD files

Unicode has lately been asking implementations to support non-Unicode
Character Database properties.  Files for these contain a different
versioning syntax than the UCD files.  Previously I was hand-editing
those files before commitiing to bring them to use a consistent style.
But that is tedious, and I decide to invest a little time to be able to
handle all the current versioning syntaxes automatically, to save having
to manually update in the future.

This was complicated by the fact that some Unicode non-UCD files have
BOM marks on many comment lines.  I submitted a trouble report to them.

4 years agoStorable: linkify alternatives references
Dagfinn Ilmari Mannsåker [Sun, 16 Feb 2020 17:22:41 +0000 (17:22 +0000)]
Storable: linkify alternatives references

Also fix typo Serial → Sereal.

4 years agoAdd 'indirect' feature that can be turned off to disable indirect object syntax 17477/head
Dagfinn Ilmari Mannsåker [Tue, 21 Jan 2020 10:35:05 +0000 (10:35 +0000)]
Add 'indirect' feature that can be turned off to disable indirect object syntax

Co-authored-by: Tony Cook <tony@develop-help.com>
4 years agoperlreguts: Update
Karl Williamson [Sat, 15 Feb 2020 17:51:59 +0000 (10:51 -0700)]
perlreguts: Update

This makes changes, mainly in dealing with the removal of the sizing
pass in 5.30.

Patches welcome for other fixes.

4 years agoUpdate perlunicode base on Unicode UTS 18, regex reqs
Karl Williamson [Sat, 15 Feb 2020 04:54:43 +0000 (21:54 -0700)]
Update perlunicode base on Unicode UTS 18, regex reqs

Unicode is revising their document on what regular expression
implementations should do.  This includes retraction of a significant
part of it, which Perl did not handle (and apparently nobody else
either).  Thus we are much closer to implementing everything they say
than before.  The document is adding some new (manageable) things, which
we do not yet support.

4 years ago.mailmap: add old addresses for Hugo
Hugo van der Sanden [Fri, 14 Feb 2020 13:08:21 +0000 (13:08 +0000)]
.mailmap: add old addresses for Hugo

4 years agoDon't reopen open file in Tie-File/t/43_synopsis.t
Craig A. Berry [Thu, 13 Feb 2020 03:07:07 +0000 (21:07 -0600)]
Don't reopen open file in Tie-File/t/43_synopsis.t

Move the untie earlier and destroy the object holding the file
open.  Otherwise the next test fails with "file currently locked by
another user" on OS's that open with exclusive locking.

4 years agoregen/regcomp.pl: Add cautionary comment
Karl Williamson [Thu, 13 Feb 2020 15:58:10 +0000 (08:58 -0700)]
regen/regcomp.pl: Add cautionary comment

So the next person spends less time than I did in figuring things out

4 years agoperluniprops: Fix missing backslash
Karl Williamson [Thu, 13 Feb 2020 15:26:12 +0000 (08:26 -0700)]
perluniprops: Fix missing backslash

4 years agoregcomp.c: Move comment
Karl Williamson [Thu, 13 Feb 2020 00:46:49 +0000 (17:46 -0700)]
regcomp.c: Move comment

This comment had gotten moved away from where it is applicable.

4 years agoperlhist - Fix date of 5.31.0
Steve Hay [Thu, 13 Feb 2020 08:01:50 +0000 (08:01 +0000)]
perlhist - Fix date of 5.31.0

4 years agoembed.fnc: Clarify comments
Karl Williamson [Sat, 8 Feb 2020 04:30:45 +0000 (21:30 -0700)]
embed.fnc: Clarify comments

4 years agolib/_charnames.pm: Fix typo in comment
Karl Williamson [Wed, 5 Feb 2020 20:59:32 +0000 (13:59 -0700)]
lib/_charnames.pm: Fix typo in comment

4 years agoAdd qr/\p{Name=...}/
Karl Williamson [Wed, 5 Feb 2020 20:32:26 +0000 (13:32 -0700)]
Add qr/\p{Name=...}/

This accomplishes the same thing as \N{...}, but only for regex
patterns, using loose matching and only the official Unicode names.

This commit includes a comparison of the two approaches, added to
perlunicode.  But the real reason to do this is as a way station to
being able to specify wild card lookup on the name property, coming in a
later commit.

I chose to not include user-defined aliases nor :short character names
at this time.  I thought that there might be unforeseen consequences of
using them.  It's better to later relax a requirement than to try to
restrict it.

4 years agoregcomp.c: Convert boolean to an enum
Karl Williamson [Wed, 5 Feb 2020 05:08:00 +0000 (22:08 -0700)]
regcomp.c: Convert boolean to an enum

This is in preparation for making this tri-valued instead of two.

4 years agotoke.c: Split code to load _charnames.pm into own fnc
Karl Williamson [Tue, 4 Feb 2020 21:43:14 +0000 (14:43 -0700)]
toke.c: Split code to load _charnames.pm into own fnc

This is in preparation for it being called from more than one place.

4 years agotoke.c: Change variable name, add one
Karl Williamson [Tue, 4 Feb 2020 21:28:59 +0000 (14:28 -0700)]
toke.c: Change variable name, add one

This if for clarity as to what's going on, and to simplify some
expressions.

4 years agotoke.c: extract charnames code from S_new_constant
Karl Williamson [Fri, 31 Jan 2020 21:07:42 +0000 (14:07 -0700)]
toke.c: extract charnames code from S_new_constant

The code for dealing with charnames is intertwined and special cased in
S_new_constant.  My guess is it was originally to offer customized,
better error messages when things go wrong.  Much later the function was
changed so that a message could be returned instead of output, and the
code didn't really need the customization any longer.  But by then
autoloading of charnames had been added when a \N[} was parsed, meaning
that more special casing was added instead, as that had been the logical
place to do it.

This commit extracts the special charnames handling to the one place it
is actually used, and the disentangled S_new_constant is then called.
This is in preparation for future commits, and makes the code cleaner.

This adds testing of the new syntax to lib/charnames.t.  That file
randomly generates some tests, simply because there are too many names
to test reasonably at once.  To compensate for the added tests, I
lowered the percentage per run of characters tested so that this file
takes about the same amount of time as before.

4 years agolib/charnames.t: Add a couple of tests
Karl Williamson [Wed, 12 Feb 2020 20:27:45 +0000 (13:27 -0700)]
lib/charnames.t: Add a couple of tests

These are problematic character names; test them always

4 years agoRemove claimed support for mbstowcs, wcstombc
Karl Williamson [Wed, 12 Feb 2020 22:02:46 +0000 (15:02 -0700)]
Remove claimed support for mbstowcs, wcstombc

As noted in perldelta, these functions could not have ever worked, and
there is no demand for them, hence no reason to make them work.

This fixes GH #17388

4 years agoRevert "pp_(get|set)priority: remove ancient glibc C++ workaround"
Dagfinn Ilmari Mannsåker [Wed, 12 Feb 2020 20:18:40 +0000 (20:18 +0000)]
Revert "pp_(get|set)priority: remove ancient glibc C++ workaround"

It turns out that even though the headers correctly define the argument
as `int` under C++, -Wc++-compat doesn't know this.

Add a comment to stop others from falling into the same trap I did.

This reverts commit 34d254cefc451e5ab438acf22a51d7b557c05a0e.

4 years agoperlreref: quantifier {,n} is now illegal
Karl Williamson [Tue, 11 Feb 2020 04:49:01 +0000 (21:49 -0700)]
perlreref: quantifier {,n} is now illegal

And has been for a while.  Update the pod.

4 years agoAdditional email (github) address for Richard Leach
James E Keenan [Tue, 11 Feb 2020 13:29:29 +0000 (13:29 +0000)]
Additional email (github) address for Richard Leach

Correct two earlier formatting errors.

4 years agoTie::File - Document use of binmode on filehandles
Richard Leach [Fri, 7 Feb 2020 22:01:25 +0000 (22:01 +0000)]
Tie::File - Document use of binmode on filehandles

Documentation fix for #17497, where the user passed a filehandle in, but the lack of binmode meant that the :crlf layer on Windows caused problems when the file was later used on Linux.

4 years agoMake Tie::File distro conform to strict and warnings.
Todd Rinaldo [Fri, 31 Jan 2020 05:02:51 +0000 (23:02 -0600)]
Make Tie::File distro conform to strict and warnings.

Fixes #17495

4 years agoRemove %newkeys from Tie::File::_oadjust
Todd Rinaldo [Mon, 3 Feb 2020 17:34:14 +0000 (11:34 -0600)]
Remove %newkeys from Tie::File::_oadjust

Recent efforts to add strict have shown this variable
wasn't even being used.

4 years agoSync Tie-File changelog with CPAN
Todd Rinaldo [Fri, 31 Jan 2020 05:02:16 +0000 (23:02 -0600)]
Sync Tie-File changelog with CPAN

4 years agoReword pod2html crossref err msgs; show only if $verbose
Marc Green [Tue, 14 Feb 2012 01:04:37 +0000 (20:04 -0500)]
Reword pod2html crossref err msgs; show only if $verbose

Fixes #11860

4 years agoadd missing RT links to older perldelta
Karen Etheridge [Mon, 10 Feb 2020 19:52:59 +0000 (11:52 -0800)]
add missing RT links to older perldelta

4 years agoimprove pod formatting and minor punctuation nit
Karen Etheridge [Mon, 10 Feb 2020 19:48:07 +0000 (11:48 -0800)]
improve pod formatting and minor punctuation nit

4 years agot/porting/manifest.t: ignore .mailmap
Yves Orton [Mon, 10 Feb 2020 09:17:15 +0000 (10:17 +0100)]
t/porting/manifest.t: ignore .mailmap

.mailmap is used by git to map emails in commit logs to their
correct form. When I added it in a04d7ffe7d4cd836bf5246ea6050612f01403a96
I checked MANIFEST for .gitignore, which I did not find, and assumed
that dotfiles were exempt from MANIFEST requirements. Similarly I
assumed there was nothing to test. Bad Yves.

This updates the test to ignore .mailmap in MANIFEST checks.

4 years ago.mailmap: add a file to allow git to show correct emails
Yves Orton [Mon, 10 Feb 2020 08:37:39 +0000 (09:37 +0100)]
.mailmap: add a file to allow git to show correct emails

the .mailmap file allows git to correct committer details in things like
git log. Compare `git log --author=yves` with `git log --use-mailmap --author=yves`
the former finds commits I have made using old email addresses, the latter
finds nothing as the corrected version of my name is "Yves Orton". Conversly
`git log --use-mailmap --author=Yves` will find pretty much *all* of my commits.

4 years agotoke.c - handle ${10} properly - Issue #12948
Yves Orton [Thu, 6 Feb 2020 07:40:57 +0000 (08:40 +0100)]
toke.c - handle ${10} properly - Issue #12948

${10} and $10 were handled differently, this patch makes them be handled
the same. It also forbids multi-digit numeric variables from starting
with 0. Thus $00 is now a new fatal exception

    "Numeric variables with more than one digit may not start with '0'"

4 years agoDocument purpose of miniperl
Tony Cook [Thu, 6 Feb 2020 13:08:24 +0000 (08:08 -0500)]
Document purpose of miniperl

For: https://github.com/Perl/perl5/issues/16158
(formerly RT 132137).

4 years agoskip op/signame_canonical test under miniperl
Hugo van der Sanden [Sun, 9 Feb 2020 16:46:15 +0000 (16:46 +0000)]
skip op/signame_canonical test under miniperl

It requires Data::Dumper

4 years agoperl.h: define PERL_BITFIELD8/16/32 as U8/U16/U32
Yves Orton [Sat, 8 Feb 2020 15:02:49 +0000 (16:02 +0100)]
perl.h: define PERL_BITFIELD8/16/32 as U8/U16/U32

After consultation with xenu we decided that defining both sets exactly the same
as U8/U16/U32 makes the most sense.

These defines were added in 654eccd594bfe8deab367b0f4cdda726a7796ff3 and the discussion
for why is here: https://www.nntp.perl.org/group/perl.perl5.porters/2008/01/msg133754.html

Short summary: Activestate added these defines so that XS code compiled with gcc on windows
could be used with a perl compiled with VC on windows, and vice-versa. Read the thread
for more details.

This patch does NOT remove the duplicate definition in win32/win32.h, I
don't feel comfortable doing that without being able to check the build,
so I will leave it to someone who has VC to test.

4 years agopp_sys.c: add casts to silence Win32 build warnings
Yves Orton [Sat, 8 Feb 2020 14:14:38 +0000 (15:14 +0100)]
pp_sys.c: add casts to silence Win32 build warnings

4 years agoregcomp.c: silence possible loss of data warnings
Yves Orton [Sat, 8 Feb 2020 12:06:07 +0000 (13:06 +0100)]
regcomp.c: silence possible loss of data warnings

added casts, and asserts to verify that we arent losing data

    ..\regcomp.c(3589) : warning C4244: '=' : conversion from 'U32' to 'U8', possible loss of data
    ..\regcomp.c(3603) : warning C4244: '=' : conversion from 'U32' to 'U16', possible loss of data
    ..\regcomp.c(4192) : warning C4244: '=' : conversion from 'unsigned long' to 'U8', possible loss of data
    ..\regcomp.c(14900) : warning C4244: '=' : conversion from 'UV' to 'char', possible loss of data
    ..\regcomp.c(14918) : warning C4244: '=' : conversion from 'UV' to 'char', possible loss of data
    ..\regcomp.c(17621) : warning C4244: 'function' : conversion from 'IV' to 'const char', possible loss of data
    ..\regcomp.c(17643) : warning C4244: 'function' : conversion from 'IV' to 'const char', possible loss of data