[Perl/perl5] fb3da3: toke.c: Restore reverted intuit_more()

[email protected] (Karl Williamson via perl5-changes)
Newsgroups perl.perl5.changes
Message-ID <Perl/perl5/push/refs/heads/blead/[email protected]>
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: fb3da3a9d06b1cdcab2857004c962c2945112071
      https://github.com/Perl/perl5/commit/fb3da3a9d06b1cdcab2857004c962c2945112071
  Author: Karl Williamson <[email protected]>
  Date:   2026-08-08 (Sat, 08 Aug 2026)

  Changed paths:
    M t/re/pat_rt_report.t
    M toke.c

  Log Message:
  -----------
  toke.c: Restore reverted intuit_more()

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
https://github.com/Perl/perl5/issues/24340#issuecomment-4237449145

This commit reapplies those commits which were removed by
b5f1509a25fe127a39b50c46cacc098c230e136b (which got applied with an
inadequate commit message).  Plus it incorporates feedback from
GH #24569.


  Commit: 9724252a0a52af5efde4d28e9010d637d5481461
      https://github.com/Perl/perl5/commit/9724252a0a52af5efde4d28e9010d637d5481461
  Author: Karl Williamson <[email protected]>
  Date:   2026-08-08 (Sat, 08 Aug 2026)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  toke.c: White space only

Arrange lines to not be more than 78 lines


  Commit: 0a84597728e9d377773511c37434cc542613ac35
      https://github.com/Perl/perl5/commit/0a84597728e9d377773511c37434cc542613ac35
  Author: Karl Williamson <[email protected]>
  Date:   2026-08-08 (Sat, 08 Aug 2026)

  Changed paths:
    M t/re/pat.t
    M toke.c

  Log Message:
  -----------
  S_intuit_more: Properly handle \\ in input

Fixes #24336

I apparently got confused between the two characters \ and ].  The
commit 7646ce7e591864e549df28dfa7246e8ebba19d14 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


  Commit: 181e914ba2fe3eb39d6355b7216090ab35bd579d
      https://github.com/Perl/perl5/commit/181e914ba2fe3eb39d6355b7216090ab35bd579d
  Author: Karl Williamson <[email protected]>
  Date:   2026-08-08 (Sat, 08 Aug 2026)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  toke.c: is_existing_identifier: Use passed in length

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.


  Commit: 6aef1e87c1ea274e225828cbc1a6044b54feec44
      https://github.com/Perl/perl5/commit/6aef1e87c1ea274e225828cbc1a6044b54feec44
  Author: Karl Williamson <[email protected]>
  Date:   2026-08-08 (Sat, 08 Aug 2026)

  Changed paths:
    M t/re/pat.t
    M toke.c

  Log Message:
  -----------
  intuit_more: Pass context to it in another instance

Fixes #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.


Compare: https://github.com/Perl/perl5/compare/9d16eaead9d9...6aef1e87c1ea

To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.