From: Steve Hancock Date: Sat, 8 May 2021 13:04:00 +0000 (-0700) Subject: Correct brace types mismarked by tokenizer, update X-Git-Tag: 20210402.01~47 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b3eaf2cde7f6e5f30f2a71ca68ac57ff6bb1743e;p=perltidy.git Correct brace types mismarked by tokenizer, update --- diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 9586cd68..e04e363f 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -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/ ); } } diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 07c2d904..60da9170 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,13 +2,22 @@ =over 4 +=item B + +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 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 @@ -61,7 +70,7 @@ containers on a separate line. This fix is for case c002. -6 May 2021. +6 May 2021, 176f8a7. =item B