]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix c074, incorrectly marked block brace
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 14 Oct 2021 21:51:21 +0000 (14:51 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 14 Oct 2021 21:51:21 +0000 (14:51 -0700)
lib/Perl/Tidy/Tokenizer.pm
local-docs/BugLog.pod

index 42557abac4ecbafa6d7a3d6a7ae12056b22aff35..432d15bb0b9811b3864c5fcecef5a0b793965f54 100644 (file)
@@ -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'}
index adbb6fa2ef6704c8f8b338d80fbcc0a48dd9907a..bb203d44da5e8eec6579ce7624e9c0d9b55a810b 100644 (file)
@@ -2,6 +2,33 @@
 
 =over 4
 
+=item B<Improve formatting of some Moose structures>
+
+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<Fix issue c081, -cscw preventing deletion of closing side comments>
 
 Random testing revealed a problem in which an old closing side comment was not