]> git.donarmstrong.com Git - perltidy.git/commitdiff
Correct brace types mismarked by tokenizer, update
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 8 May 2021 13:04:00 +0000 (06:04 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 8 May 2021 13:04:00 +0000 (06:04 -0700)
lib/Perl/Tidy/Tokenizer.pm
local-docs/BugLog.pod

index 9586cd68b0f6645a5a6e2c5fbf2ba302d08562f5..e04e363fd328c02bd97df7c7cdac3d46f9631117 100644 (file)
@@ -5378,13 +5378,12 @@ sub decide_if_code_block {
             }
         }
 
-        if ( $code_block_type && $pre_types[$j] eq '}' ) {
+        if ($code_block_type) {
 
-            # Patch for case b1085: if we hit the sentinal token then it is
-            # uncertain if this is a block.  If this brace follows a bareword,
-            # then append a space as a signal to the formatter that this may
-            # not be a block brace.  To find the corresponding code in
-            # Formatter.pm search for 'b1085'.
+            # Patch for cases b1085 b1128: It is uncertain if this is a block.
+            # If this brace follows a bareword, then append a space as a signal
+            # to the formatter that this may not be a block brace.  To find the
+            # corresponding code in Formatter.pm search for 'b1085'.
             $code_block_type .= " " if ( $code_block_type =~ /^\w/ );
         }
     }
index 07c2d90471048587c10939e2a6857aab9a7e6a0e..60da917044388a716e0fc73c18cca4e5682e7767 100644 (file)
@@ -2,13 +2,22 @@
 
 =over 4
 
+=item B<Correct brace types mismarked by tokenizer, update>
+
+This is a generalization of commit 7d3bf4 in which the tokenizer sends a signal
+to the formatter if the type of a brace following an unknown bareword had to be
+guessed.  The formatter has more information and can fix the problem.  This
+fixes case b1128.
+
+8 May 2021.
+
 =item B<Added warning when -ci has to be reduced; ref rt #136415>
 
 In commit c16c5ee an update was made to prevent instability with -xci when
 the value of -ci exceeds -i (which is not recommended).  This update adds a
 warning message to avoid confusing the user.
 
-7 May 2021.
+7 May 2021, e9e14e4.
 
 =item B<Improve indentation of welded multiline qw quotes>
 
@@ -61,7 +70,7 @@ containers on a separate line.
 
 This fix is for case c002.
 
-6 May 2021.
+6 May 2021, 176f8a7.
 
 =item B<Test length of closing multiline qw quote before welding>