Skip to content

Restore intuit_more changes - #24569

Open
khwilliamson wants to merge 5 commits into
Perl:bleadfrom
khwilliamson:backout_intuit_more
Open

Restore intuit_more changes#24569
khwilliamson wants to merge 5 commits into
Perl:bleadfrom
khwilliamson:backout_intuit_more

Conversation

@khwilliamson

Copy link
Copy Markdown
Contributor

A series of commits changing intuit_more() were reverted late in the
5.43 series. There were bugs introduced or shown by these commits, and
it was decided to revert rather than try to patch them. See
#24340 (comment)

This PR reapplies those commits which were removed by
b5f1509a25fe127a39b50c46cacc098c230e136b (which got applied with an
inadequate commit message). And it fixes the bugs that have surfaced as a result of those commits

  • This set of changes does not require a perldelta entry.

@jkeenan

jkeenan commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

In the previous dev cycle changes introduced into blead in 7646ce7 (v5.43.8-88-g7646ce7e59) were cited in GH #24230 as causing breakage in 3 CPAN distributions:

  • App::CPAN::Mini::Visit
  • Proc::Async
  • Biblio::SICI (at least on DEBUGGING builds)

This breakage was cleaned up by the reversion in #24367, so as of the release of perl-5.44.0 this week, these 3 distributions were passing on CPANtesters.

To assess the impact of re-introducing the 'intuit_more' changes proposed in this pull request, I created a local branch from the p.r., built a DEBUGGING perl with this configuration:

$ ./perl -Ilib -V:config_args
config_args='-des -Dusedevel -DDEBUGGING -Dprefix=/home/jkeenan/testing/gh-24569-khwilliamson-backout_intuit_more-20260718 -Uversiononly -Dman1dir=none -Dman3dir=none';

... then attempted to install the 3 distros listed above.

All 3 built, tested and installed correctly.

$ ./bin/perl -Ilib  -MApp::CPAN::Mini::Visit -MProc::Async -MBiblio::SICI -E 'say q|hello world gh-24569|;'
hello world gh-24569

Comment thread t/re/pat_rt_report.t Outdated
Comment thread toke.c Outdated
Comment thread toke.c Outdated
Comment thread toke.c Outdated
Comment thread toke.c
Comment thread toke.c
Comment on lines +4932 to +4937
# define embraced 1 << 0
# define unembraced 0
# define unknown 0
# define known 1 << 1
# define len1 0
# define multi 1 << 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to #undef these all at the end of the function / block, otherwise any use of those as variable names for the rest of toke.c could lead to very confusing error messages.

Either that, or maybe make them enum { ... } constants instead so they don't leak.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now undef'd

Comment thread toke.c
Comment on lines +5055 to +5059
* But, due to a bug in setting up the loop terminating
* condition, a ']' would never occur. That bug was fixed so
* late in the development cycle that we didn't want to
* possibly break anything, so this is commented out to retain
* previous (unintended) behavior */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible we can un-comment this again now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in a later PR

khwilliamson added a commit to khwilliamson/perl5 that referenced this pull request Jul 23, 2026
A series of commits changing intuit_more() were reverted late in the
5.43 series.  There were bugs introduced or shown by these commits, and
it was decided to revert rather than try to patch them.  See
Perl#24340 (comment)

This commit reapplies those commits which were removed by
b5f1509a25fe127a39b50c46cacc098c230e136b (which got applied with an
inadequate commit message).  Plus it incorporates feedback from
GH Perl#24569.
@khwilliamson
khwilliamson force-pushed the backout_intuit_more branch from 0a4172c to 19db18b Compare July 23, 2026 02:37
A series of commits changing intuit_more() were reverted late in the
5.43 series.  There were bugs introduced or shown by these commits, and
it was decided to revert rather than try to patch them.  See
Perl#24340 (comment)

This commit reapplies those commits which were removed by
b5f1509a25fe127a39b50c46cacc098c230e136b (which got applied with an
inadequate commit message).  Plus it incorporates feedback from
GH Perl#24569.
Arrange lines to not be more than 78 lines
Fixes Perl#24336

I apparently got confused between the two characters \ and ].  The
commit 7646ce7 dealt with both.

What is needed for the sequence \\ is that it act like a single \
escaping nothing.

What is needed for the sequence \] is that it do nothing beyond what it
used to do, despite the intent of the code that that commit partially
fixed.  The sequence could never occur before in practice because it was
excluded by logic that that commit did fix.  But since it is so late in
the development cycle; I decided to comment out what it now would have
done, so that there was no difference in behavior for that precise
sequence.

But the commit got things wrong, which this should rectify
This is embarrassing.

The length of the string is passed in, and then just ignored in one
case.  Change to using the 'pvn' form with the length.
Fixes Perl#24339

This bug stemmed from the code correctly determining that a [...] was a
character class and not a subscript, but then forgetting about it.

The solution is to pass the context to intuit_more() from places where
I hadn't realized it was available, and then check that context.  That
gives intuit_more the information it needs to quickly realize that yes,
this was a character class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants