]> git.donarmstrong.com Git - perltidy.git/commitdiff
Fix parsing error at operator following a comma
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 28 May 2021 04:52:15 +0000 (21:52 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 28 May 2021 04:52:15 +0000 (21:52 -0700)
lib/Perl/Tidy/Tokenizer.pm
local-docs/BugLog.pod

index a9fea6e9a6bcf1d3e869f9e3722a80d606ff71c3..2e5f6bc84565524ee3dd0770fac83d56836e1261 100644 (file)
@@ -2844,13 +2844,13 @@ EOM
 
         '&&' => sub {
             error_if_expecting_TERM()
-              if ( $expecting == TERM );
-        },
+              if ( $expecting == TERM && $last_nonblank_token ne ',' );    #c015
+          },
 
         '||' => sub {
             error_if_expecting_TERM()
-              if ( $expecting == TERM );
-        },
+              if ( $expecting == TERM && $last_nonblank_token ne ',' );    #c015
+          },
 
         '//' => sub {
             error_if_expecting_TERM()
index 07f34efe40effddd3b80a198915de8215277ae4c..57f539a690a21b8ce588476b72a53ec08e711710 100644 (file)
@@ -2,6 +2,26 @@
 
 =over 4
 
+=item B<Fix parsing error at operator following a comma>
+
+The following lines are syntactically correct but some were producing a
+syntax error
+
+    print "hello1\n", || print "hi1\n";
+    print "hello2\n", && print "bye2\n";
+    print "hello3\n", or print "bye3\n";
+    print "hello4\n", and print "bye4\n";
+
+For example, the first line produced this message
+
+    1: print "hello1\n", || print "hi1\n";
+                       - ^
+    found || where term expected (previous token underlined)
+
+This has been fixed. This fixes case c015.
+
+27 May 2021.
+
 =item B<Added optional o in octal number definitions>
 
 An optional letter 'o' or 'O' in the octal representation of numbers, which was
@@ -13,7 +33,7 @@ For example:
     $a = 0o100;
     $a = 0O100;
 
-26 May 2021.
+26 May 2021, 544df8c.
 
 =item B<Fix several problems with -lp formatting>