Skip Menu |

This queue is for tickets about the PPR CPAN distribution.

Report information
The Basics
Id: 132397
Status: resolved
Priority: 0/
Queue: PPR

People
Owner: Nobody in particular
Requestors: albert.tests [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Don't stop perl on: Quantifier in {,} bigger than 32766 in regex
Date: Wed, 22 Apr 2020 13:43:28 +0200
To: bug-PPR [...] rt.cpan.org
From: Albert <albert.tests [...] gmail.com>
Based on my question on stackoverflow ( https://stackoverflow.com/questions/61363512/dont-stop-perl-on-quantifier-in-bigger-than-32766-in-regex ): In the question https://stackoverflow.com/questions/61307663/retain-newlines-for-pod-in-case-of-ppruncomment and this was solved in the answer, by defining a a new method `decomment2` that leaves the newlines properly. All works quite well, but now I have a file to process with a very big HERE document (far to big to publish here so unfortunately a link to an external site): https://github.com/openssl/openssl/blob/master/crypto/bn/asm/ppc.pl When this file is processed through the `PPR::decomment2` I get the message: ``` Quantifier in {,} bigger than 32766 in regex; marked by <-- HERE in m/(?s:.{ <-- HERE 39303})/ at /home/User/perl5/lib/perl5/Doxygen/Filter/Perl.pm line 1222. ``` this line 1222 is the line `$str =~ m{ \A (?&PerlDocument) \Z` in the `PPR::decomment2` method`. At that moment the perl process terminates. - is there a way to enlarge this "32766" i.e 2**15-2 in some way? - is there a way not to terminate the perl process but set the `PPR::ERROR` or another flag, so this can be processed in the code? <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Subject: Re: [rt.cpan.org #132397] Don't stop perl on: Quantifier in {,} bigger than 32766 in regex
Date: Thu, 23 Apr 2020 00:05:50 +0000
To: bug-PPR [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Hi Albert, Thanks for the bug report. You asked: Show quoted text
> - is there a way to enlarge this "32766" i.e 2**15-2 in some way?
No. Not easily. It's hard-wired into your perl executable. If you upgrade to Perl 5.30, the 32766-character limit on counted repetitions been doubled in that release. But that's only postponing the problem, not solving it. Your code will still break on a larger heredoc. Show quoted text
> - is there a way not to terminate the perl process but set the
`PPR::ERROR` Show quoted text
> or another flag, so this can be processed in the code?
Not easily, as the exception is thrown within the $PPR::GRAMMAR regex and I have yet to find a reliable way to catch exceptions thrown within regexes. So, since I can't help you in either of those ways, I thought I'd better just solve the original problem. ;-) The latest release of the PPR module (version 0.000025, which was uploaded to CPAN about an hour ago) no longer has this arbitrary limitation on the length of heredocs. If you upgrade to that release of PPR, your problem should disappear. All the best, Damian
Subject: Re: [rt.cpan.org #132397] Don't stop perl on: Quantifier in {,} bigger than 32766 in regex
Date: Thu, 23 Apr 2020 18:20:19 +0200
To: bug-PPR [...] rt.cpan.org
From: Albert <albert.tests [...] gmail.com>
I've just tested it and the results look OK to me. Thanks for the fast action. Best Regards, Albert <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Thu, Apr 23, 2020 at 2:06 AM damian@conway.org via RT < bug-PPR@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=132397 > > > Hi Albert, > > Thanks for the bug report. > > You asked: >
> > - is there a way to enlarge this "32766" i.e 2**15-2 in some way?
> > No. Not easily. It's hard-wired into your perl executable. > > If you upgrade to Perl 5.30, the 32766-character limit on counted > repetitions been doubled in that release. But that's only postponing > the problem, not solving it. Your code will still break on > a larger heredoc. > >
> > - is there a way not to terminate the perl process but set the
> `PPR::ERROR`
> > or another flag, so this can be processed in the code?
> > Not easily, as the exception is thrown within the $PPR::GRAMMAR regex > and I have yet to find a reliable way to catch exceptions thrown within > regexes. > > > So, since I can't help you in either of those ways, > I thought I'd better just solve the original problem. ;-) > > The latest release of the PPR module (version 0.000025, which was > uploaded to CPAN about an hour ago) no longer has this arbitrary > limitation on the length of heredocs. If you upgrade to that release > of PPR, your problem should disappear. > > All the best, > Damian > >