]> perl5.git.perl.org Git - perl5.git/log This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
2 days agoDeparse: exclude two new test files blead
David Mitchell [Mon, 28 Apr 2025 13:19:20 +0000 (14:19 +0100)]
Deparse: exclude two new test files

Add a couple of recently-added test files to

    Porting/deparse-skips.txt

These two test files have

    use utf8;
    "some string with accented chars"

and the accented char gets deparsed wrongly at the moment.
So skip those test files under

    cd t; ./TEST -deparse

2 days agoDeparse: fix 3-arg susbtr_left deparsing
David Mitchell [Mon, 28 Apr 2025 12:25:09 +0000 (13:25 +0100)]
Deparse: fix 3-arg susbtr_left deparsing

v5.41.7-43-gcdbed2a40e introduced the OP_SUBSTR_LEFT op,
which is an optimised version of OP_SUBSTR for when the offset
is zero and the replacement string is missing or ''.

Unfortunately the deparsing for this OP missed out the closing
parenthesis when the replacement string wasn't present; i.e.:

    substr($lex, 0, 4);

deparsed as:

    substr($lex, 0, 4;

The fix is trivial.

2 days agolocale.c: Add debug for MB_CUR_MAX
Karl Williamson [Tue, 22 Apr 2025 17:00:27 +0000 (11:00 -0600)]
locale.c: Add debug for MB_CUR_MAX

The latest MacOS release has locales that set this wrongly.  This isn't
the first time this has been a problem.  Add a debugging line that can
easily be enabled to check for problems that may arise in  the field.

3 days agosv.h: SvPVx now equivalent to SvPV, et.al
Karl Williamson [Thu, 30 Jan 2025 11:26:23 +0000 (04:26 -0700)]
sv.h: SvPVx now equivalent to SvPV, et.al

These macros suffixed with 'x' are guaranteed to evaluate their
arguments just once.  Prior to this commit, they used PL_Sv to
accomplish that.  But since 1ef9039bccb in 5.37, the macros they call
only evaluate their arguments once, so the PL_Sv is superfluous.

4 days agoFix finding the correct cplusplus compiler
Chris 'BinGOs' Williams [Sat, 26 Apr 2025 15:16:34 +0000 (16:16 +0100)]
Fix finding the correct cplusplus compiler

ExtUtils::CBuilder was using a slightly maverick method for
finding the matching cplusplus compiler to the c compiler
used to build perl.

On a Linux system with a perl built with the Oracle Developer cc
cc='/opt/oracle/developerstudio12.6/bin/cc'

Errors were observed:
"c++: error: unrecognized command line option ‘-KPIC’; did you mean ‘-fPIC’?"

The cplusplus command for Oracle Developer suite is CC not c++ and the
detection was picking up the system c++ (g++).

If there is a ccpath, the code should exhaust all the options and not fail
through to using no path.

Added a test to exercise ccpath behaviour

Added clang/clang++ to the C->C++ compiler mappings

6 days agoperldelta for setting cygperl*.dll image base
Tony Cook [Mon, 9 Dec 2024 22:21:43 +0000 (09:21 +1100)]
perldelta for setting cygperl*.dll image base

6 days agoRevert "cygwin: workaround DLL load address conflict"
Tony Cook [Mon, 9 Dec 2024 05:25:47 +0000 (16:25 +1100)]
Revert "cygwin: workaround DLL load address conflict"

This reverts commit ff4c75e237e9d4f574da4e379bcc20e2604bf79f.

6 days agocygwin: give cygperl*.dll an explicit base address
Tony Cook [Mon, 9 Dec 2024 05:24:19 +0000 (16:24 +1100)]
cygwin: give cygperl*.dll an explicit base address

Cygwin's fork emulation doesn't handle overlapping addresses
between different DLLs, since it tries to lay out the address space
of the child process to match the parent process, but if there's an
address conflict between DLLs, Windows may load those DLLs at
different addresses.

To avoid having to manually assign addresses to each DLL, since
around 5.10 we've used --enable-auto-image-base to assign load
addresses for cygperl*.dll and dynamic extension DLLs and this
has mostly worked well, but as perl has gotten larger and
cygperl*.dll has grown, we've had two cases where there's overlap
between the address space for cygperl*.dll and some extension
DLL, see #22695 and #22104.

This problem occurs because:

- cygperl*.dll is large, and with -DDEBUGGING or some other option
  that increases binary size, even large, occupying more than one of
  the "slots" that the automatic image base code in ld can assign
  the DLL to.

- unlike the extension DLLs, the name of cygperl*.dll changes with
  every release, so we roll the dice each release on whether there
  will be a conflict between cygperl*.dll and some other DLL.

Previously I've added an entry to perldelta and updated the CI
workflow to workaround the conflict, this change should prevent
that particular conflict.

The addresses I've chosen here are "just" (for large values of
"just") below the base address range used by automatic address
space selection.

For 64-bit this was done by inspection, examing the output of
"rebase -i" on the extension DLLs and looking at the source of ld,
in particular:

  https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/emultempl/pep.em;h=00c4ea9e15a765c29b15b621f53d6bfcb499e5ed;hb=HEAD#l144

Note cygwin builds set move_default_addr_high=1 if you read that code.

For 32-bit I just looked at the source:

  https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/emultempl/pe.em;h=52f59b8b#l173

since I don't have a 32-bit cygwin install any more, since cygwin
no longer ship it and it commonly had the fork address conflicts
discussed above.

I would have liked to make the load address configurable via
-Dcygperl_base or similar, but I didn't see a way to get the
base address to pass from Configure through to Makefile.SH.

Fixes #22695

6 days ago[Win32] Define some Socket-related %Config keys
sisyphus [Thu, 17 Oct 2024 04:18:15 +0000 (15:18 +1100)]
[Win32] Define some Socket-related %Config keys

Affects only mingw-w64 builds of perl. Fixes:
https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/221

6 days agoperldiag: remove `for my (...) is experimental`
Dagfinn Ilmari Mannsåker [Wed, 23 Apr 2025 10:56:43 +0000 (11:56 +0100)]
perldiag: remove `for my (...) is experimental`

The experiment was accepted in perl 5.40.

6 days ago5.41.12 delta.pod: Fix advice about Darwin locale collation
Karl Williamson [Tue, 22 Apr 2025 16:06:10 +0000 (10:06 -0600)]
5.41.12 delta.pod: Fix advice about Darwin locale collation

7 days agomem_collxfrm(): White space, comments, only
Karl Williamson [Sun, 20 Apr 2025 18:01:00 +0000 (12:01 -0600)]
mem_collxfrm(): White space, comments, only

The previous commit removed a block; so can outdent

7 days agomem_collxfrm(): Return early if locale collation not sane
Karl Williamson [Sun, 20 Apr 2025 17:57:19 +0000 (11:57 -0600)]
mem_collxfrm(): Return early if locale collation not sane

This changes a subsidiary function's return value from void to bool,
returning false if it finds the locale doesn't have sane collation.

The calling function is changed to check this, and give up immediately
if the locale isn't sane.

7 days agolocale.c: Don't do asymmetric back out on failure
Karl Williamson [Tue, 22 Apr 2025 14:24:36 +0000 (08:24 -0600)]
locale.c: Don't do asymmetric back out on failure

This fixes #23519

When something goes wrong doing locale-aware string collation, the code
attempts to carry on as well as can be expected.  Prior to this commit
the backout code was asymmetric, trying to undo things that had not been
done.  This happened when the failure was early on.

In the case of this ticket, the platform has a defective locale that was
detectable before getting very far along.

The solution adopted here is to jump to a different label for those
early failures that does less backout than for later failures.

7 days agolocale.c: Change name of macro
Karl Williamson [Tue, 22 Apr 2025 14:22:22 +0000 (08:22 -0600)]
locale.c: Change name of macro

This is in preparation for the next commit where it will be split out
to be a stand-alone macro.

9 days agoSpelling correction only.
James E Keenan [Tue, 22 Apr 2025 01:36:41 +0000 (21:36 -0400)]
Spelling correction only.

9 days agoupdate current release status for Module::CoreList
Karen Etheridge [Mon, 21 Apr 2025 23:28:09 +0000 (16:28 -0700)]
update current release status for Module::CoreList

9 days agoUpdate Module::CoreList for 5.41.13
Karen Etheridge [Mon, 21 Apr 2025 23:27:15 +0000 (16:27 -0700)]
Update Module::CoreList for 5.41.13

9 days agoBump the perl version in various places for 5.41.13 (hypothetical)
Karen Etheridge [Mon, 21 Apr 2025 23:11:28 +0000 (16:11 -0700)]
Bump the perl version in various places for 5.41.13 (hypothetical)

9 days agoNew perldelta for 5.41.12
Karen Etheridge [Mon, 21 Apr 2025 23:07:12 +0000 (16:07 -0700)]
New perldelta for 5.41.12

9 days agoadd 5.41.12 epigraph
Karen Etheridge [Mon, 21 Apr 2025 23:06:13 +0000 (16:06 -0700)]
add 5.41.12 epigraph

..and fix the link for 5.41.11

9 days agotick off the release
Karen Etheridge [Mon, 21 Apr 2025 23:04:26 +0000 (16:04 -0700)]
tick off the release

9 days agoAdd new release to perlhist v5.41.12
Karen Etheridge [Mon, 21 Apr 2025 22:18:18 +0000 (15:18 -0700)]
Add new release to perlhist

9 days agofinalize perldelta
Karen Etheridge [Mon, 21 Apr 2025 22:16:42 +0000 (15:16 -0700)]
finalize perldelta

9 days agoUpdate Module::CoreList for 5.41.12
Karen Etheridge [Mon, 21 Apr 2025 22:11:45 +0000 (15:11 -0700)]
Update Module::CoreList for 5.41.12

9 days agofix version in comment
Karen Etheridge [Mon, 21 Apr 2025 17:58:06 +0000 (10:58 -0700)]
fix version in comment

9 days agoreally fix the syntax this time
Karen Etheridge [Mon, 21 Apr 2025 17:25:14 +0000 (10:25 -0700)]
really fix the syntax this time

thanks mauke and khw!

9 days agooops, extra paren
Karen Etheridge [Mon, 21 Apr 2025 15:42:25 +0000 (08:42 -0700)]
oops, extra paren

9 days agoUnicode 16.0.0 was actually added in 5.41.11
Karen Etheridge [Mon, 21 Apr 2025 03:28:53 +0000 (20:28 -0700)]
Unicode 16.0.0 was actually added in 5.41.11

This entry was missed because I generated the MCL entries before the unicode
patch was actually applied. Therefore, the cpan release of Module::CoreList
5.20250420 will be incorrect, but all subsequent releases (and blead itself,
from 5.41.12 or 5.42.0 onward) will be correct.

9 days agoUpdate Module::CoreList for 5.41.12
Karen Etheridge [Mon, 21 Apr 2025 03:23:54 +0000 (20:23 -0700)]
Update Module::CoreList for 5.41.12

9 days agoBump the perl version in various places for 5.41.12
Karen Etheridge [Mon, 21 Apr 2025 02:52:15 +0000 (19:52 -0700)]
Bump the perl version in various places for 5.41.12

9 days agorecord new release of Module::CoreList
Karen Etheridge [Mon, 21 Apr 2025 02:57:13 +0000 (19:57 -0700)]
record new release of Module::CoreList

9 days agoadd epigraph for 5.41.11
Karen Etheridge [Mon, 21 Apr 2025 02:09:44 +0000 (19:09 -0700)]
add epigraph for 5.41.11

9 days agoNew perldelta for 5.41.11
Karen Etheridge [Mon, 21 Apr 2025 02:08:17 +0000 (19:08 -0700)]
New perldelta for 5.41.11

10 days agotick off 5.41.11 release
Karen Etheridge [Mon, 21 Apr 2025 02:00:24 +0000 (19:00 -0700)]
tick off 5.41.11 release

10 days agoAdd new release to perlhist v5.41.11
Karen Etheridge [Sun, 20 Apr 2025 18:49:58 +0000 (11:49 -0700)]
Add new release to perlhist

10 days agofinalize perldelta
Karen Etheridge [Sun, 20 Apr 2025 18:10:34 +0000 (11:10 -0700)]
finalize perldelta

10 days agoUpdate Module::CoreList for 5.41.11
Karen Etheridge [Sun, 20 Apr 2025 18:09:16 +0000 (11:09 -0700)]
Update Module::CoreList for 5.41.11

10 days agoadd missing entries for CVE-2024-56406, perlguts edit
Karen Etheridge [Sun, 20 Apr 2025 18:22:22 +0000 (11:22 -0700)]
add missing entries for CVE-2024-56406, perlguts edit

10 days agominor tweaks to formatting of new content
Karen Etheridge [Sun, 20 Apr 2025 17:28:37 +0000 (10:28 -0700)]
minor tweaks to formatting of new content

10 days agoTurn off locale collation in Darwin
Karl Williamson [Sun, 20 Apr 2025 23:54:02 +0000 (17:54 -0600)]
Turn off locale collation in Darwin

With 5.41.11, Darwin is failing in its libc with:

Assertion failed: (p->val == key), function lookup_substsearch, file
collate.c, line 596.

This started after we upgraded to Unicode 16.0.

10 days agoperldelta for Unicode update
Karl Williamson [Sun, 20 Apr 2025 14:27:29 +0000 (08:27 -0600)]
perldelta for Unicode update

10 days agomk_invlists: Update comments
Karl Williamson [Sun, 20 Apr 2025 14:27:00 +0000 (08:27 -0600)]
mk_invlists: Update comments

10 days agoRevert "Temporarily skip regen porting test in this branch"
Karl Williamson [Sat, 19 Apr 2025 02:42:27 +0000 (20:42 -0600)]
Revert "Temporarily skip regen porting test in this branch"

This temporary commit has now served its purpose.

10 days agomk_invlists: Restore generating EBCDIC
Karl Williamson [Sat, 19 Apr 2025 02:38:36 +0000 (20:38 -0600)]
mk_invlists: Restore generating EBCDIC

This had been turned off in this branch to speed up compilatian, and
hence development.  The code mostly changed in this branch is the same
as in ASCII anyway.  It could have become an issue only if someone tries
to bisect on an EBCDIC machine, which I don't believe has happened, if
ever, in decades.

10 days agomktables: Note break table code for Unicode 16.0 is updated
Karl Williamson [Thu, 17 Apr 2025 18:11:21 +0000 (12:11 -0600)]
mktables: Note break table code for Unicode 16.0 is updated

10 days agoAdd Unicode 16.0
Unicode Consortium [Thu, 17 Apr 2025 18:03:18 +0000 (12:03 -0600)]
Add Unicode 16.0

This is includes updates to a few perl files that need to know the
current Unicode version, and regenerating perl files that depend on the
Unicode data

10 days agomktables: Prepare for Unicode 16.0
Karl Williamson [Thu, 17 Apr 2025 17:11:14 +0000 (11:11 -0600)]
mktables: Prepare for Unicode 16.0

10 days agomk_invlists/regexec.c: Prepare for Unicode 16.0
Karl Williamson [Thu, 17 Apr 2025 15:59:15 +0000 (09:59 -0600)]
mk_invlists/regexec.c: Prepare for Unicode 16.0

10 days agomk_invlists: Include cells in calculating column widths
Karl Williamson [Thu, 17 Apr 2025 16:12:12 +0000 (10:12 -0600)]
mk_invlists: Include cells in calculating column widths

This program generates tables for the Break properties that are somewhat
human readable.  Before this commit, just the heading line for a column
determined its width.  This commit factors in the maximum width of any
cell in the column as well.  It used to be that this required a separate
pass, and so wasn't done.  But now that separate pass is required anyway
for other reasons, and it is simple to add to it this check.

10 days agomk_invlists: Restore calculation of new keywords, etc
Karl Williamson [Thu, 17 Apr 2025 22:12:30 +0000 (16:12 -0600)]
mk_invlists: Restore calculation of new keywords, etc

Now we are ready to use a new Unicode version, we have to regenerate
everything.  This was turned off earlier in this branch temporarily
until now so as to speed up the testing, as it was known these values
wouldn't change until now.

10 days agomktables: Prepare for Unicode 15.1
Karl Williamson [Fri, 18 Apr 2025 19:32:52 +0000 (13:32 -0600)]
mktables: Prepare for Unicode 15.1

10 days agomk_invlists/regexec.c: Prepare for Unicode 15.1
Karl Williamson [Fri, 18 Apr 2025 23:10:13 +0000 (17:10 -0600)]
mk_invlists/regexec.c: Prepare for Unicode 15.1

10 days agoUCD.t: Skip test which fails on 32 bit words
Karl Williamson [Sun, 20 Apr 2025 11:09:13 +0000 (05:09 -0600)]
UCD.t: Skip test which fails on 32 bit words

In Unicode 15.1, the ideograph U+4EAC now has a numeric value, and that
value is 10 quadrillion (1e+16).  This is the first instance in Unicode
of an integer not fitting in a 32 bit word, as this requires 49 bits.
One of the tests in UCD.t requires round-trip equality in converting
from string to number and back; skip it for this case and any future
similar ones.

I find it interesting that U+4EAC is listed as having the meaning
"capital city".

10 days agolib/Unicode/UCD.t: Prepare for Unicode 15.1
Karl Williamson [Fri, 18 Apr 2025 23:03:17 +0000 (17:03 -0600)]
lib/Unicode/UCD.t: Prepare for Unicode 15.1

The  numeric value for U+5146 changed in 15.1

10 days agomk_invlists: Add a shorter form DFA
Karl Williamson [Fri, 18 Apr 2025 18:22:58 +0000 (12:22 -0600)]
mk_invlists: Add a shorter form DFA

This is just for legibility of reading the rules

10 days agomk_invlists: Remove hard-coded numbers
Karl Williamson [Wed, 16 Apr 2025 22:00:03 +0000 (16:00 -0600)]
mk_invlists: Remove hard-coded numbers

A couple of commits ago, the last necessarily-hard-coded DFA enum
besides 0 and 1  was removed.  This allows for all the rest to be
assigned by using the value of an incrementing variable.

This makes it easy to add DFAs in the middle of existing ones, as will
happen as future Unicode releases come our way.

10 days agomk_invlists: Look for a DFA optimization possibility
Karl Williamson [Wed, 16 Apr 2025 04:52:31 +0000 (22:52 -0600)]
mk_invlists: Look for a DFA optimization possibility

If both branches of an else lead to the same result, skip the else and
set the result unconditionally.  That's what this commit does for DFAs
that get the same value if they succeed as when they don't.

There is one current case where the DFA can return an anomalous result,
so it can't be optimized out.  Add a field to the hash entry defining
that entry, so it doesn't get optimized.

10 days agomk_invlists: Remove no longer used function
Karl Williamson [Thu, 17 Apr 2025 21:10:26 +0000 (15:10 -0600)]
mk_invlists: Remove no longer used function

10 days agomk_invlists: Remove a no longer used enum
Karl Williamson [Thu, 17 Apr 2025 20:43:39 +0000 (14:43 -0600)]
mk_invlists: Remove a no longer used enum

The new generalized DFA scheme makes this value moot; it was used to get
around not having such a scheme.

10 days agomk_invlists: Remove a temporary work-around
Karl Williamson [Wed, 16 Apr 2025 21:47:20 +0000 (15:47 -0600)]
mk_invlists: Remove a temporary work-around

This code was due to a few commits ago having reversed the ordering the
Unicode rules are applied in.  After updating to use a generalized DFA
scheme, it is no longer needed

10 days agomk_invlists: Remove accesses of unused parameter
Karl Williamson [Fri, 18 Apr 2025 09:39:36 +0000 (03:39 -0600)]
mk_invlists: Remove accesses of unused parameter

set_cells() no longer reads this parameter; no need to pass it nor set it
up.

10 days agomk_invlists: Use new DFA scheme for horizontal white space
Karl Williamson [Fri, 18 Apr 2025 09:21:02 +0000 (03:21 -0600)]
mk_invlists: Use new DFA scheme for horizontal white space

Perl doesn't follow the Unicode standard with regard to its treatment of
white space, in particular sequences of horizontal white space.  Unicode
allows "tailoring" of its rules for local situations, and Perl
traditionally with \B  has treated all sequences of white space as a
single unit.  Unicode originally considered each space in a sequence of
them as a separate unit.  A perl program would want them all a single
unit.  Unicode eventually came round to our way of thinking, but not
entirely, as comments unaffected by this commit indicate.

The DFA for this situation does not fit in with the new stackable DFA
scheme, and woul start failing tests a few commits later as the shim
code is removed.  Convert to the new scheme, which allows us to call the
functions that affect a single cell twice with effect.  The order is
immaterial, but one call installs a default behavior, and the other a DFA
that ends up being executed first to override that behavior in certain
(rare) situations.

10 days agomk_invlists: Generalize to stack DFAs for break properties
Karl Williamson [Wed, 16 Apr 2025 15:28:19 +0000 (09:28 -0600)]
mk_invlists: Generalize to stack DFAs for break properties

The Unicode breaking algorithms are supposed to be implemented by
executing DFAs in priority order, stopping at the first one that
succeeds.  (In many cases a DFA isn't needed, and we can unconditionally
say that there is or isn't a break at a given position simply by looking
at the characters on either side of it.)

But it was a significant amount of work to get from where perl started
to be able to do that.  And it hasn't been necessary until now.  In most
cases, a single DFA suffices, and where not, a more complicated single
DFA took care of the stacking.

But this has become untenable in Unicode 15.1, so I ended up doing the
work to implement their algorithm.  The result is more, but simpler
DFAs, and it becomes easier to add new ones, as they don't have to
interact with other ones.  The stacking does that for them.

This commit implements a separate DFA table beyond the x,y lookup table.
If the decision that this is a breakable position requires a DFA, the
x,y contents are an index into this separate table, which contains the
DFA to follow.  The first element gives the case statement number to use
to execute the DFA.  The second element gives the value to return if the
DFA succeeds.  If it fails, the code add +2 to get the next thing to
try.

10 days agomk_invlists: Use new mktables enhancements
Karl Williamson [Tue, 15 Apr 2025 13:39:28 +0000 (07:39 -0600)]
mk_invlists: Use new mktables enhancements

Now mk_invlists no longer has to know what the details are of properties
that have been split into more, smaller equivalence classes.  mktables
handles that and provides the information in new hashes.

10 days agomktables: Consolidate code into a single function
Karl Williamson [Mon, 7 Apr 2025 18:35:35 +0000 (12:35 -0600)]
mktables: Consolidate code into a single function

Some properties in Unicode essentially form equivalence classes for all
possible code points.

For example, Unicode publishes the Line Break (LB) property, where each
possible code point is given a type, like Alphabetic, or Opening
Parenthesis.  All code points that act as alphabetics have the AL
equivalence class.  All that act like Opening Parentheses have the OP
class.

Unicode also publishes rules as to if it is permissible to break between
code point of any types.  For the Line Break property, you wouldn't
break a line between two alphabetics or between an opening parenthesis
and an alphabetic, but you could between a Space and almost any other
type or between a closing parenthesis and many types.

Perl uses these properties to implement the \b{lb} etc regular
expression constructs.  It uses a two-dimensional array where the value
in the cell [x,y] tells whether a break is permissible between
characters of type x and characters of type y.  (Some cases can't be
done with this simple lookup, but knowing the surrounding context is
necessary to make a decision.  Those are implemented as DFAs in
regexec.c.)

Unicode used to publish such an array for the Line Break property, and
still publishes some non-normative .html files that contain similar
information.  But to really know what to do, one has to read documents
UAX#14 and UAX#29 that contain textual descriptions of the rules.  These
change each new release, and are the major pain in upgrading to a new
release.

In recent releases, Unicode has mostly stopped creating new equivalence
classes as it has refined the rules for the boundary conditions  For
example, the line boundary conditions are very different for East Asian
(EA) characters than the Western scripts.  Effectively there are thus
two sets of rules.  But instead of creating new equivalence classes that
reflect this reality, Unicode has chosen to just document it in those
two UAX documents.  I don't know the motivation for this.

But perl wants that table to divvy up all the possible boundary
conditions, so it can continue to use the array to make most of the
decisions, so mktables splits the equivalence classes that Unicode
provides into new ones that reflect what the UAXes say.  At first, I
thought this was a one-off matter, so wrote a few lines to handle a
special case; then when the next release came out, added a few more for
another one, etc.  But Unicode 15.1 and 16.0 continue the trend, so it's
become an effort.

This commit consolidates the previous one-off code snippets into one
generalized function.  It should be able to handle future instances
without having to craft something new each time.

It also creates a new data structure that mk_invlists.pl can look at so
that it doesn't have to repeat the logic found here, as it currently
does.

10 days agoregexec.c: Skip CM and ZWJ in look behind in LB parsing
Karl Williamson [Fri, 18 Apr 2025 02:43:32 +0000 (20:43 -0600)]
regexec.c: Skip CM and ZWJ in look behind in LB parsing

The Unicode standard says that these two characters are to be ignored
for the purposes of determining if there is a Line Break just before
certain characters.  That is, you have to back up in the parse string
past all adjacent ones of these, and then examine it.

This applies to any lower priority rule than LB9.  This commit fixes two
cases that didn't do that.

10 days agoregexec.c: Change static function API
Karl Williamson [Fri, 18 Apr 2025 02:39:08 +0000 (20:39 -0600)]
regexec.c: Change static function API

Sometimes this functionality is needed to also skip over certain
intervening classes of characters while backing up in the parse string.
This commit creates two macros to call the modified underlying function
with a boolean flag.  This names of the macros make it easy to know
what's happening.

10 days agoregexec.c: Change function name
Karl Williamson [Tue, 15 Apr 2025 16:04:03 +0000 (10:04 -0600)]
regexec.c: Change function name

The new name is longer, but it makes clear that it does something that
the reader of this code might find unexpected.

10 days agoregexec.c: Change static function API
Karl Williamson [Tue, 15 Apr 2025 15:40:10 +0000 (09:40 -0600)]
regexec.c: Change static function API

This makes it clearer to use.  Instead of having a boolean flag to
change the behavior, there are now two macros that call the underlying
function, and their names reflect the desired behavior

10 days agomk_invlists: rm no longer used sub
Karl Williamson [Mon, 14 Apr 2025 13:20:54 +0000 (07:20 -0600)]
mk_invlists: rm no longer used sub

The previous commit took away the need for this.

10 days agomk_invlists: Add ability to tie table cell changes together
Karl Williamson [Mon, 14 Apr 2025 13:12:23 +0000 (07:12 -0600)]
mk_invlists: Add ability to tie table cell changes together

Some Unicode rules say that some cells are supposed to be changed at the
same time their master cells are.  This commit forms that linkage.

10 days agomk_invlists: Remove some special cases
Karl Williamson [Tue, 15 Apr 2025 13:09:51 +0000 (07:09 -0600)]
mk_invlists: Remove some special cases

These were added to compensate for reversing the order of handling the
break property rules.  This commit hides the need for that in one place
per table, except for a second place for Line Break.

The only changes to the tables occur in the garbage row and column which
aren't actually accessed, so those changes are harmless.

It is a temporary commit.  A few commits from now, this will be removed.

10 days agomk_invlists: Remove obsolete function
Karl Williamson [Sat, 12 Apr 2025 23:24:50 +0000 (17:24 -0600)]
mk_invlists: Remove obsolete function

This function was used when the previous scheme of applying the rules in
reverse order needed to be overridden in a few cases by prohibiting
changes to existing seemingly lower priority values.  Now there's
no lower priority value in the cell that we would need to preserve.

10 days agomk_invlists: Reverse order of break property rules
Karl Williamson [Mon, 14 Apr 2025 10:43:08 +0000 (04:43 -0600)]
mk_invlists: Reverse order of break property rules

Before this commit, the rules for populating the tables for break
properties were laid out in reverse order, so that the lowest priority
rule was executed first.  It filled a cell, which then would be
overwritten by any higher priority rule that applied to it.

This reverse order made it harder to compare the rules with the text of
the Unicode rules these are trying to implement.

This commit changes things to have the rules in the same order as
Unicode lists them.

The previous scheme had certain advantages that this has to make up for
by using temporary code to override what would otherwise have gone into
the cells.  This code will no longer be needed in a few commits when a
general purpose stacking DFA scheme is implemented.

As a result, of this temporary code, only two cells in one property
change as a result of this complete reversal.  They change to using a
DFA which ends up returning the same results as the original
unconditional value.

10 days agomk_invlists/regexec.c: Generate and use macros
Karl Williamson [Fri, 28 Mar 2025 09:13:20 +0000 (03:13 -0600)]
mk_invlists/regexec.c: Generate and use macros

With this commit, mk_invlists.pl now generates #define macros isFOO that
regexec.c now uses to determine if a character is in a particular line
breaking class.  Previously, x == foo was used.  This change insulates
the code from having to worry about when classes get changed to be
combinations.

10 days agomk_invlists: Add fields to data structure
Karl Williamson [Fri, 28 Mar 2025 01:46:43 +0000 (19:46 -0600)]
mk_invlists: Add fields to data structure

This converts each DFA form just a number into a separate hash in a
bigger hash with more information besides that number.

This extra information will be needed in a future commit.

10 days agomk_invlists: Reorder some hash entries
Karl Williamson [Wed, 16 Apr 2025 13:13:34 +0000 (07:13 -0600)]
mk_invlists: Reorder some hash entries

The new order is based on the order of their respective rules; the next
commit expands these, and it makes it easier for a human to look up.

10 days agomk_invlists: Add rule numbers to break table output
Karl Williamson [Mon, 31 Mar 2025 03:49:23 +0000 (21:49 -0600)]
mk_invlists: Add rule numbers to break table output

This is very helpful in debugging, and correlating the tables with the
Unicode UAX documents from which they are derived.

10 days agomk_invlists: Improve DFA names
Karl Williamson [Thu, 27 Mar 2025 13:17:58 +0000 (07:17 -0600)]
mk_invlists: Improve DFA names

This commit now imposes more structure on the names.

The names are sort of pseudo code that lays out what the DFA is to do.
The most significant change is to standardize what has been done in
recent commits with newly added DFAs.  And that is to use the string
'_v_' in the name where the tip of the 'v' points to where position in
the input string being processed where this rule applies to.

10 days agomk_invlists: Use 'for' statement modifier
Karl Williamson [Sat, 12 Apr 2025 23:32:46 +0000 (17:32 -0600)]
mk_invlists: Use 'for' statement modifier

This significantly cuts down on the verbiage, and makes the rules in
this file more closely match the text from which they are derived in UAX
14 and UAX 29

10 days agomk_invlists: Use abbreviations for Line Break
Karl Williamson [Thu, 27 Mar 2025 00:37:45 +0000 (18:37 -0600)]
mk_invlists: Use abbreviations for Line Break

Unicode UAX #14 gives rules for the Line Break property using the short
names for them.  Prior to this commit, we mostly used the full names for
the classes in this property.  This commit changes to use the short
names.  This makes it easier to compare the code here with the UAX text.
The abbreviations aren't always straight forward, so it was easy to go
astray.

10 days agomk_invlists: Use new set subtraction ability
Karl Williamson [Wed, 9 Apr 2025 10:18:57 +0000 (04:18 -0600)]
mk_invlists: Use new set subtraction ability

This allows the removal of some combinatorial complexity, thus showing
a bug in which the combination of PO to EOP had not been added when it
should have been.

Currently, mktables splits the Line Break OP and CP classes into East
Asian ones, and the remainders.  The extra combinations occurred because
the code here needed to take every existing OP and add an East_Asian
(EA_OP) equivalent; same with CP.  It's easy to miss one, and I did.

This commit allows this split to be hidden from most places in
mk_invlists.

10 days agomk_invlists: Add ability to get set subtraction
Karl Williamson [Tue, 8 Apr 2025 17:51:36 +0000 (11:51 -0600)]
mk_invlists: Add ability to get set subtraction

This capability will be used in future commits, so that the
implementation can more closely follow Unicode's text

10 days agomk_invlists: Use new split capability with MidNumLetQ
Karl Williamson [Sun, 30 Mar 2025 21:57:56 +0000 (15:57 -0600)]
mk_invlists: Use new split capability with MidNumLetQ

This follows on the previous commit, with the other Word Break property
name that Unicode macroizes

10 days agomk_invlists: Use new split capability with AHLetter
Karl Williamson [Sun, 30 Mar 2025 21:52:23 +0000 (15:52 -0600)]
mk_invlists: Use new split capability with AHLetter

The description in UAX #29 of Unicode's Word Break property uses two
convenience macros to simplify some of their rules.

The split capability introduced several commits ago, allows this program
to follow along, making the rules here more closely aligned to the text
in UAX 29, hence simpler.

This commit creates one macro, AHLetter; the next commit does the other
macro.

The name of the DFAs involving this name are changed to correspond.

10 days agomk_invlists: Use new split capability with ExtPict
Karl Williamson [Sat, 12 Apr 2025 19:39:41 +0000 (13:39 -0600)]
mk_invlists: Use new split capability with ExtPict

\p{Extended_Pictographic} is not fully implemented yet because unlike
other properties, it can match a string instead of a single character.

And it is kind of a kludge here  The 14.0 release was analyzed by me and
the rules here were customized based on that analysis.  For example, in
the Line Break property, a clause was added by Unicode to Rule LB30b
that required taking the intersection of this property and all the
Unassigned code points.  It turns out that everything in that
intersection had the Line Break class of Ideographic, so I modified
mktables to split the Ideographic class into two components, the
elements of the intersection went into the long-named
"Unassigned_Extended_Pictographic_Ideographic" and plain Ideographic was
left with the remainder.  To match all of Ideographic you have to
specify both classes.  By using the new split capability, this can be
done effectively as a macro expansion, and the special cases can be
removed from the code.  This commit does this.

Similarly, both the Word Break and Grapheme Cluster Break properties
have somewhat different interactions with Extended_Pictographic that
this commit smooths over.

This situation is brittle.  A new release of Unicode might change things
so that Ideographic isn't the only LB class in the intersection
mentioned above, so the customization has to be checked in every
release.  A few commits later in this branch, this will be automated,
and no longer a concern.

10 days agomk_invlists: Use new split capability with ALetter
Karl Williamson [Fri, 18 Apr 2025 01:05:43 +0000 (19:05 -0600)]
mk_invlists: Use new split capability with ALetter

ALetter also contains the class ExtPict_LE.  Prior to this commit, there
had to be a rule for each ALetter doing the same thing with ExtPict_LE.
But the new splits capability allows ALetter to expand automatically to
both.

This uncovers a bug.  There should have been a rule
 WB5 ALetter x ExtPict_LE
which was missing.

10 days agomk_invlists: Add effectively macro expansions
Karl Williamson [Wed, 26 Mar 2025 11:34:45 +0000 (05:34 -0600)]
mk_invlists: Add effectively macro expansions

Unicode's Word Break rules have shortcut names that really mean multiple
ones.  For example, AHLetter means either ALetter or Hebrew_Letter.

This commit allows "macros" to be defined like this so that the
statements in this file more closely resemble those of the Unicode text.

More importantly, Unicode's rules in recent times need subdivided
equivalence classes, such as Alphabetics that are also East Asian.  What
has been done so far is when that happened, extra rules were added that
were all possible combinations of these subdivisions.  It is easy to
miss a combination; and it turns out there are bugs.  This new
capability allows us to say that an Alphabetic (ALetter) is a
combination of plain ALetters plus East Asian letters, and the code
generates all the combinations automatically.  This makes the text
cleaner and safer.

10 days agomk_invlists: Allow abbreviations for break classes
Karl Williamson [Mon, 24 Mar 2025 12:49:17 +0000 (06:49 -0600)]
mk_invlists: Allow abbreviations for break classes

And use them in a couple of places.  This will allow the rules to more
closely align with the Unicode text, which uses abbreviations just
sometimes.

10 days agomk_invlists: move decls comments around
Karl Williamson [Sun, 23 Mar 2025 16:18:18 +0000 (10:18 -0600)]
mk_invlists: move decls comments around

10 days agomk_invlists: Handle Combining Mark: changes CMxZWJ
Karl Williamson [Mon, 24 Mar 2025 00:14:11 +0000 (18:14 -0600)]
mk_invlists: Handle Combining Mark: changes CMxZWJ

This is separated out from the previous commit because it is tricky XXX

10 days agomk_invlists: Add ability to specify a complement of list
Karl Williamson [Sun, 23 Mar 2025 12:37:23 +0000 (06:37 -0600)]
mk_invlists: Add ability to specify a complement of list

And use it in one instance.

Previous commits have added the ability to pass multiple items simply to
the functions that work on rows and columns.  This now gives the ability
to complement the set of the multiple items passed.

10 days agomk_invlists: Add no_nobreak_override()
Karl Williamson [Tue, 8 Apr 2025 15:50:59 +0000 (09:50 -0600)]
mk_invlists: Add no_nobreak_override()

This new function allows removing loops from the main code

10 days agomk_invlists: Allow arbitrary list of cells
Karl Williamson [Sun, 23 Mar 2025 11:40:01 +0000 (05:40 -0600)]
mk_invlists: Allow arbitrary list of cells

This follows up on the previous commit which allowed simply specifying
an entire row or column.  This adds the ability to specify a list.

10 days agomk_invlists: Add ability to specify an entire row simply
Karl Williamson [Sun, 23 Mar 2025 12:19:32 +0000 (06:19 -0600)]
mk_invlists: Add ability to specify an entire row simply

Instead of having to loop through all the cells of a row or column, this
commit uses '*' to represent the whole thing.  This is more in keeping
with the text of the Unicode rules which just leaves thing blank if it
means everything;

10 days agomk_invlists: Reorder two statements
Karl Williamson [Sun, 23 Mar 2025 11:14:43 +0000 (05:14 -0600)]
mk_invlists: Reorder two statements

This now matches the order that Unicode gives; for easier checking that
our code matches their demands.

10 days agomk_invlists: Set values in unused table cells to 0
Karl Williamson [Wed, 9 Apr 2025 12:47:54 +0000 (06:47 -0600)]
mk_invlists: Set values in unused table cells to 0

These cells exist so that code is less likely to need to be changed when
a new Unicode release comes along.  Currently it doesn't matter at all
what is in those cells, because they are never read.  But future commits
will want to make sure they don't refer to dfas that are obsolete and
whose references to could be undefined symbols that would abort the
compilation.

The choice of 0 or 1 to put in the cells was arbitrary; I know of no
reason to prefer one or the other

10 days agomk_invlists: Hoist calculation to sub callers
Karl Williamson [Wed, 9 Apr 2025 12:16:26 +0000 (06:16 -0600)]
mk_invlists: Hoist calculation to sub callers

And pass the result to the subroutine.

This is in preparation for this value to be needed in additional places.

10 days agomk_invlists: Set and get break table values with functions
Karl Williamson [Sun, 23 Mar 2025 10:29:39 +0000 (04:29 -0600)]
mk_invlists: Set and get break table values with functions

Previously, we would just set an individual element directly.  This
changes most of those to use function calls instead.  This has two main
benefits.  The function can change what's being done without having to
change many lines; and these sets had a lot of visual noise with sigils
and hash references.  The result is a lot easier to read.

The next few commits will continue this process.

Note that the generated tables are unchanged by this commit.  It has no
effect on runtime processing.  That will be true of the next commits as
well.

It became obvious in doing this that the rule for Perl_Tailored_HSpace
does not belong in the 3's, but comes immediately before that.
Arbitrarily use '2z'