Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: 9dda41b1191ea601daf917721e21e27cbedd2e62
https://github.com/Perl/perl5/commit/9dda41b1191ea601daf917721e21e27cbedd2e62
Author: Richard Leach <[email protected]>
Date: 2026-09-07 (Mon, 07 Sep 2026)
Changed paths:
M regcomp.c
M regcomp_internal.h
Log Message:
-----------
S_reg - add static helper for flattening nested branches
This commit attempts to flatten BRANCHes within a BRANCH, mostly for the
benefit of conversion of EXACT alternations into fewer TRIE nodes.
For example, prior to this commit, the following pattern:
/mat|mat2|(?:mat3|mat4)|mat5|(?:mat6|mat7)/
would compile to:
1: TRIEC-EXACT[m] (35)
<mat> (35)
<mat2> (35)
<mat> (13)
13: TRIE-EXACT[34] (35)
<3>
<4>
<mat5> (35)
<mat> (28)
28: TRIE-EXACT[67] (35)
<6>
<7>
35: END (0)
now it compiles to:
1: EXACT <mat> (3)
3: TRIE-EXACT[2-7] (35)
<>
<2>
<3>
<4>
<5>
<6>
<7>
35: END (0)
The commit only flattens branches where the branch tails directly match.
Exactly when and to what extent inner branches get flattened may change
as this behaviour is further refined.
Commit: 68787dde3f0f228c706b76fe2b9d0fcf56505ec6
https://github.com/Perl/perl5/commit/68787dde3f0f228c706b76fe2b9d0fcf56505ec6
Author: Richard Leach <[email protected]>
Date: 2026-09-07 (Mon, 07 Sep 2026)
Changed paths:
M t/re/opt.t
M t/re/re_tests
Log Message:
-----------
t/re/opt.t - add tests for nested branch flattening
Commit: 4155d8589cc6d45e42647cc3d66c4245574148dc
https://github.com/Perl/perl5/commit/4155d8589cc6d45e42647cc3d66c4245574148dc
Author: Richard Leach <[email protected]>
Date: 2026-09-07 (Mon, 07 Sep 2026)
Changed paths:
M pod/perldelta.pod
Log Message:
-----------
Perldelta entry for nested regop BRANCH flattening
Compare: https://github.com/Perl/perl5/compare/b35a6ea61ae0...4155d8589cc6
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications