develooper Front page | perl.perl5.porters | Postings from June 2016

Re: The new Unescaped-left-brace-warning can be noisy

Thread Previous | Thread Next
From:
Karl Williamson
Date:
June 20, 2016 21:57
Subject:
Re: The new Unescaped-left-brace-warning can be noisy
Message ID:
576866BA.9070704@khwilliamson.com
On 06/20/2016 12:39 PM, Andreas Koenig wrote:
> Karl,
>
> FWIW, on GWILLIAMS/IRI-0.005.tar.gz 'make test' used to produce ~433
> bytes, now ~3348343. This causes the normal reporting mechanisms to
> refuse to work, so this does not show up on cpantesters.
>
> If you are looking for tests that trigger the new warnings, here are
> others:
>
> http://www.cpantesters.org/cpan/report/f5acc38e-363d-11e6-82f7-cd4e388fbd9d
> (KJETILK/RDF-Trine-Node-Literal-XML-0.16.tar.gz)

Every one of the above warnings is almost certainly a bug in the module, 
as all of them are of the form /\{,\d\}/.  It appears that they believe 
that one can omit the lower bound of a quantifier.  Indeed that is part 
of the purpose of this deprecation, to change the language so that this 
lower bound can be omitted.  But it isn't the case today, and the code 
compiles into matching the sequence "{" "," \d "}", silently until now.
>
> http://www.cpantesters.org/cpan/report/ee393738-362c-11e6-83b5-bcf7378fbd9d
> (GWILLIAMS/Attean-0.017.tar.gz)

This is the exact same thing, omitting the lower bound of a quantifier. 
  The new warning has caught an existing bug in the code.
>
> http://www.cpantesters.org/cpan/report/c9f77224-35f8-11e6-974b-b539388fbd9d
> (IVANWILLS/File-CodeSearch-v0.7.4.tar.gz)

This is probably just the warning legitimately deprecating an existing 
legitimate usage.  There are two constructs failing ".{-1}" and .{-2}". 
  It's possible those are very weird attempts at a quantifier, but it 
seems to me more likely that the author meant to literally match the 
sequence "{" "-" "1" "}".  The report shows three instances of this warning.

>
> Thanks,
>

So I'm not sure what to do about this.  The tests show all three of the 
examples are either bugs in the modules, or show correctly a 
now-deprecated usage.

I looked at IRI, and it has 5 occurrences of the {,\d} paradigm.  I will 
look further to see if those are the things that could be causing all 
the noise, and issue a PR on it.

Maybe the regex compiler should not show the entire pattern when it 
finds problems, but instead some amount (perhaps a large amount) of 
context around the error.



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About