From 7e873fa82ab1a37d33130cd201d6066cd3915aec Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Thu, 14 Oct 2021 14:51:21 -0700 Subject: [PATCH] fix c074, incorrectly marked block brace --- lib/Perl/Tidy/Tokenizer.pm | 4 +++- local-docs/BugLog.pod | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 42557aba..432d15bb 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -5922,8 +5922,10 @@ sub is_non_structural_brace { # otherwise, it is non-structural if it is decorated # by type information. # For example, the '{' here is non-structural: ${xxx} + # Removed '::' to fix c074 + ## $last_nonblank_token =~ /^([\$\@\*\&\%\)]|->|::)/ return ( - $last_nonblank_token =~ /^([\$\@\*\&\%\)]|->|::)/ + $last_nonblank_token =~ /^([\$\@\*\&\%\)]|->)/ # or if we follow a hash or array closing curly brace or bracket # For example, the second '{' in this is non-structural: $a{'x'}{'y'} diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index adbb6fa2..bb203d44 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,33 @@ =over 4 +=item B + +In some structures used in Moose coding, some asymmetrical container breaks +were being caused by the braces being tokenized as hash braces rather than +block braces. This was also causing some unwanted warning messages. + + # OLD + ::is( + ::exception { has '+bar' => ( default => sub { 100 } ); + }, + undef, + '... extended the attribute successfully' + ); + + # NEW + ::is( + ::exception { + has '+bar' => ( default => sub { 100 } ); + }, + undef, + '... extended the attribute successfully' + ); + +This fixes issue c074. + +12 Oct 2021. + =item B Random testing revealed a problem in which an old closing side comment was not -- 2.39.5