Skip Menu |

This queue is for tickets about the Perl-Tidy CPAN distribution.

Report information
The Basics
Id: 131288
Status: resolved
Priority: 0/
Queue: Perl-Tidy

People
Owner: Nobody in particular
Requestors: nomad [...] null.net
Cc:
AdminCc:

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



Subject: Parse failure (unmatched bracket?)
Date: Sun, 29 Dec 2019 12:52:03 +0100
To: bug-Perl-Tidy [...] rt.cpan.org
From: Mark Lawrence <nomad [...] null.net>
Perl compiles and runs the attached .pm file just fine, but Perl::Tidy has an issue on both Cygwin and Linux. -- Mark Lawrence

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

On Sun Dec 29 06:59:11 2019, nomad@null.net wrote: Show quoted text
> Perl compiles and runs the attached .pm file just fine, but Perl::Tidy > has an issue on both Cygwin and Linux. >
Thanks for the bug report. The parsing problem can be reduced to the following three lines: sub OptArgs2::STYLE_FULL { 3 } $style == OptArgs2::STYLE_FULL ? 'FullUsage' : 'NormalUsage', 'usage: ' . $usage . "\n"; What happened is that perltidy doesn't know that OptArgs2::STYLE_FULL is a constant, so it may be looking for args. The ? can either start a ternary or it can start a pattern, so the parser has to guess. It guessed wrong in this case. I will fix this. But here are two workarounds: Fix 1 (best): declare an empty prototype so perltidy knows there are no args: sub OptArgs2::STYLE_FULL () { 3 } $style == OptArgs2::STYLE_FULL ? 'FullUsage' : 'NormalUsage', 'usage: ' . $usage . "\n"; Fix 2: give an empty list call args: sub OptArgs2::STYLE_FULL { 3 } $style == OptArgs2::STYLE_FULL() ? 'FullUsage' : 'NormalUsage', 'usage: ' . $usage . "\n"; Steve ~ -- VISUAL LINE -- 17,1 All
Subject: Re: [rt.cpan.org #131288] Parse failure (unmatched bracket?)
Date: Sun, 29 Dec 2019 16:43:47 +0100
To: Steve Hancock via RT <bug-Perl-Tidy [...] rt.cpan.org>
From: nomad [...] null.net
Hi Steve, Many thanks for the quick response! I wish I was half as good at supporting my tools :-( The workaround(s) is a great unblocker... Mark -- Mark Lawrence
This is fixed in version 20200110. Thanks again for reporting it. Steve