]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix for git #124 20230912
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 12 Sep 2023 19:59:38 +0000 (12:59 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 12 Sep 2023 19:59:38 +0000 (12:59 -0700)
24 files changed:
CHANGES.md
bin/perltidy
docs/ChangeLog.html
docs/Tidy.html
docs/perltidy.html
lib/Perl/Tidy.pm
lib/Perl/Tidy.pod
lib/Perl/Tidy/Debugger.pm
lib/Perl/Tidy/Diagnostics.pm
lib/Perl/Tidy/FileWriter.pm
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/HtmlWriter.pm
lib/Perl/Tidy/IOScalar.pm
lib/Perl/Tidy/IOScalarArray.pm
lib/Perl/Tidy/IndentationItem.pm
lib/Perl/Tidy/Logger.pm
lib/Perl/Tidy/Tokenizer.pm
lib/Perl/Tidy/VerticalAligner.pm
lib/Perl/Tidy/VerticalAligner/Alignment.pm
lib/Perl/Tidy/VerticalAligner/Line.pm
t/snippets/expect/git124.def [new file with mode: 0644]
t/snippets/git124.in [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets28.t

index f215aba0bfad1529011a5a5a78d3a62d4c619348..9b63831c3610ab70c2e6460a50b05232e1dc9f58 100644 (file)
@@ -1,5 +1,10 @@
 # Perltidy Change Log
 
+## 2023 09 12
+
+    - Fix for git #124: remove a syntax error check which could cause
+      an incorrect error message when List::Gather::gather was used.
+
 ## 2023 09 09
 
     - Added new parameters -wme, or --warn-missing-else, and -ame,
index 0ba47c79971d9c2e862c3b3c91610b666fc7d20f..e1bfac641f9becccb1e684fac3cb63833f06d0f8 100755 (executable)
@@ -5878,7 +5878,7 @@ The perltidy binary uses the Perl::Tidy module and is installed when that module
 
 =head1 VERSION
 
-This man page documents perltidy version 20230909
+This man page documents perltidy version 20230912
 
 =head1 BUG REPORTS
 
index 890dde2e3158afaf21e3aecbb509e1aacf4984ac..05b1f064c9a36755c2213c33f609df6fcd983c91 100644 (file)
@@ -1,5 +1,11 @@
 <h1>Perltidy Change Log</h1>
 
+<h2>2023 09 12</h2>
+
+<pre><code>- Fix for git #124: remove a syntax error check which could cause
+  an incorrect error message when List::Gather::gather was used.
+</code></pre>
+
 <h2>2023 09 09</h2>
 
 <pre><code>- Added new parameters -wme, or --warn-missing-else, and -ame,
index 08176cfdf755498be1b00794e9ebcf2a029f323b..4a755b8be2690aa8d833e4695d66ee2dbc74657d 100644 (file)
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents Perl::Tidy version 20230909</p>
+<p>This man page documents Perl::Tidy version 20230912</p>
 
 <h1 id="LICENSE">LICENSE</h1>
 
index a8529626e078184bf304d79ac96af48b22f78742..18cc304919fead9c91d2c4675915e15d6a95c01e 100644 (file)
 
 <h1 id="VERSION">VERSION</h1>
 
-<p>This man page documents perltidy version 20230909</p>
+<p>This man page documents perltidy version 20230912</p>
 
 <h1 id="BUG-REPORTS">BUG REPORTS</h1>
 
index c059e79dc3b6bfae132d2a4f711b38ccc3ce880f..12b207ead116cd5fb979d11a4e58baff5628e1a6 100644 (file)
@@ -111,7 +111,7 @@ BEGIN {
     # then the Release version must be bumped, and it is probably past time for
     # a release anyway.
 
-    $VERSION = '20230909';
+    $VERSION = '20230912';
 } ## end BEGIN
 
 sub DESTROY {
index d420dc8c809d44cdff5772e39d7bee68cd5ba5c6..277a34a4fa06c344756695576ee05649a607c9cf 100644 (file)
@@ -469,7 +469,7 @@ The module 'Perl::Tidy' comes with a binary 'perltidy' which is installed when t
 
 =head1 VERSION
 
-This man page documents Perl::Tidy version 20230909
+This man page documents Perl::Tidy version 20230912
 
 =head1 LICENSE
 
index ffba2cecba2625028d701249e358be2bdcd262c3..7d0ae4435ef14b7f81620bddb643b21208c4b9ba 100644 (file)
@@ -8,7 +8,7 @@ package Perl::Tidy::Debugger;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 use constant EMPTY_STRING => q{};
 use constant SPACE        => q{ };
index e1dbb90a46b9aebae910313746ca6fa8b0a6f38d..2826fd290e625079ebe546839d532d0a88e1f7bf 100644 (file)
@@ -18,7 +18,7 @@ package Perl::Tidy::Diagnostics;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 use constant EMPTY_STRING => q{};
 
index 877ff0c7bd65e2b9cd3b2bd6eefa743f61f30ded..44ad10b3cf175a5d4ea8463e7858cb30952a77e7 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::FileWriter;
 use strict;
 use warnings;
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index aeb77367117088b89b9ded80d52af71f40196449..c5cca23731331b1029c8e5ca3ab04262d964fe93 100644 (file)
@@ -53,7 +53,7 @@ use constant SPACE        => q{ };
 use Carp;
 use English    qw( -no_match_vars );
 use List::Util qw( min max first );    # min, max first are in Perl 5.8
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 # The Tokenizer will be loaded with the Formatter
 ##use Perl::Tidy::Tokenizer;    # for is_keyword()
index 4ed4ead85d404facb974658e885aceeaad89d425..d1f03873f0e93d33bca11f8c398d0a4469192436 100644 (file)
@@ -7,7 +7,7 @@
 package Perl::Tidy::HtmlWriter;
 use strict;
 use warnings;
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 use English qw( -no_match_vars );
 use File::Basename;
index f1d6cc851a3fbc447b8951f546d08136be8a247b..386d0d11531d19e733473d6904063025308bf485 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::IOScalar;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 use constant DEVEL_MODE   => 0;
 use constant EMPTY_STRING => q{};
index be5531e6669eda68bf5e67150b4de6ed70db9b46..deb54bdc01e836edaf5d2db4ee190d1d914ba889 100644 (file)
@@ -14,7 +14,7 @@ package Perl::Tidy::IOScalarArray;
 use strict;
 use warnings;
 use Carp;
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 use constant DEVEL_MODE => 0;
 
index a9a8b86a15d711d7e4444e8b7134edfb0b97a946..83cfb15f0c3e5093941b9b9392cfca151e6f9deb 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::IndentationItem;
 use strict;
 use warnings;
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 BEGIN {
 
index 27ad2d72703d279e4cff60b3b243aa36dc6c715e..7daf081949d02a7ca3ed7ae68f41796d1aeab78c 100644 (file)
@@ -8,7 +8,7 @@
 package Perl::Tidy::Logger;
 use strict;
 use warnings;
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 use English qw( -no_match_vars );
 
 use constant DEVEL_MODE   => 0;
index f63dc7e719a692450514325b29dc9af899b3a202..e5289e28520fa97e647f475bf9c5e055a31bc041 100644 (file)
@@ -22,7 +22,7 @@ use strict;
 use warnings;
 use English qw( -no_match_vars );
 
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 use Carp;
 
@@ -3199,8 +3199,12 @@ EOM
                 if ( defined($rvars) ) {
                     my ( $type_lp, $want_brace ) = @{$rvars};
 
-                    # Now verify that this is not a trailing form
-                    if ( !$want_brace ) {
+                    # OLD: Now verify that this is not a trailing form
+                    # FIX for git #124: we have to skip this check because
+                    # the 'gather' keyword of List::Gather can operate on
+                    # a full statement, so it isn't possible to be sure
+                    # this is a trailing form.
+                    if ( 0 && !$want_brace ) {
                         $self->warning(
 "syntax error at ') {', unexpected '{' after closing ')' of a trailing '$last_nonblank_token'\n"
                         );
index 9cb12a989ead38a9f1feace5244530605bdfc53d..0928dd4ef7c0f6f8cfe6594a5915bb0d6d6ed6ed 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 use Carp;
 use English qw( -no_match_vars );
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 use Perl::Tidy::VerticalAligner::Alignment;
 use Perl::Tidy::VerticalAligner::Line;
 
index 7b66141542d18c5826363572472a29392e1b4fb0..c16f56642eb2e12adde145ebf74d671e6c7d6255 100644 (file)
@@ -10,7 +10,7 @@ use warnings;
 
 { #<<< A non-indenting brace
 
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 sub new {
     my ( $class, $rarg ) = @_;
index 3452e35369d8bc847d8305e9ecaa66384c87fa19..60808a2653c2b44594d2b5faca8a4e7eef9b91a8 100644 (file)
@@ -10,7 +10,7 @@ package Perl::Tidy::VerticalAligner::Line;
 use strict;
 use warnings;
 use English qw( -no_match_vars );
-our $VERSION = '20230909';
+our $VERSION = '20230912';
 
 sub AUTOLOAD {
 
diff --git a/t/snippets/expect/git124.def b/t/snippets/expect/git124.def
new file mode 100644 (file)
index 0000000..9dc06b6
--- /dev/null
@@ -0,0 +1,8 @@
+sub git124 {
+    return [
+        gather while ( my $foo = $bar->foobar )
+        {
+            ...;
+        }
+    ];
+}
diff --git a/t/snippets/git124.in b/t/snippets/git124.in
new file mode 100644 (file)
index 0000000..9dc06b6
--- /dev/null
@@ -0,0 +1,8 @@
+sub git124 {
+    return [
+        gather while ( my $foo = $bar->foobar )
+        {
+            ...;
+        }
+    ];
+}
index e3c562adcb78b3624d703375d4c0e9abd321c9a8..fed612932f433f649254224bec039df2b31fbfa5 100644 (file)
 ../snippets28.t        xbt.xbt3
 ../snippets28.t        lrt.def
 ../snippets28.t        lrt.lrt
+../snippets28.t        ame.ame
+../snippets28.t        ame.def
 ../snippets3.t ce_wn1.ce_wn
 ../snippets3.t ce_wn1.def
 ../snippets3.t colin.colin
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
-../snippets28.t        ame.ame
-../snippets28.t        ame.def
+../snippets28.t        git124.def
index a2984c4c76b30b6c54219ca2027bdc56ba41ad79..173bee127fbe77755ae2bcdf9442c8b1c204d5d8 100644 (file)
@@ -16,6 +16,7 @@
 #13 lrt.lrt
 #14 ame.ame
 #15 ame.def
+#16 git124.def
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -62,6 +63,17 @@ print "Tried to add: @ResolveRPM\n" if ( @ResolveRPM and !$Quiet );
 print "Would need: @DepList\n" if ( @DepList and !$Quiet );
 print "RPM Output:\n" unless $Quiet;
 print join( "\n", @RPMOutput ) . "\n" unless $Quiet;
+----------
+
+        'git124' => <<'----------',
+sub git124 {
+    return [
+        gather while ( my $foo = $bar->foobar )
+        {
+            ...;
+        }
+    ];
+}
 ----------
 
         'lrt' => <<'----------',
@@ -365,6 +377,21 @@ sub hello {
     elsif ( $level == 2 ) { $val = $global{'chapter'} }
 #15...........
         },
+
+        'git124.def' => {
+            source => "git124",
+            params => "def",
+            expect => <<'#16...........',
+sub git124 {
+    return [
+        gather while ( my $foo = $bar->foobar )
+        {
+            ...;
+        }
+    ];
+}
+#16...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};