From 6371be254bf0eb0a0e428082c614148c359c562e Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 16 Mar 2021 08:07:13 -0700 Subject: [PATCH] Fix error in parsing use statement curly brace --- lib/Perl/Tidy/Tokenizer.pm | 5 +++++ local-docs/BugLog.pod | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index df08f0d4..05356a25 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -5194,6 +5194,11 @@ sub code_block_type { # check bareword elsif ( $last_nonblank_type eq 'w' ) { + + # check for syntax 'use MODULE LIST' + # This fixes b1022 b1025 b1027 b1028 b1029 b1030 b1031 + return "" if ( $statement_type eq 'use' ); + return decide_if_code_block( $i, $rtokens, $rtoken_type, $max_token_index ); } diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 71723a09..7abb706b 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,18 @@ =over 4 +=item B + +Testing with random parameters produced some cases where the -xci option was +not producing stable results when the maximum line length was set to a very +small value. The problem was traced to the tokenizer misparsing a hash brace +of a use statement as a code block type. This influences the value of +continuation indentation within the braces. The problem was fixed. + +This fixes cases b1022 b1025 b1026 b1027 b1028 b1029 b1030 + +16 Mar 2021. + =item B Testing with random parameters produced some situation where the parameter -iob -- 2.39.5