]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1470, b1474
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 19 May 2024 00:43:38 +0000 (17:43 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 19 May 2024 00:43:38 +0000 (17:43 -0700)
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index 93ded12d8e0e4682aabee758480fd5c6a021fda3..27c455cee4a20b39a6294426f749127a8e12a1bd 100644 (file)
@@ -12101,6 +12101,22 @@ my @outer = (
 --break-before-paren=2
 --opening-square-bracket-right
 
+==> b1470.in <==
+         $opt= {
+                  iparse(  { Maxiter => 200, Eps => 1e-4, }, ifhref($opt) )
+         };
+
+         $opt= { iparse( { Maxiter => 200, Eps => 1e-4, },
+                           ifhref($opt) ) };
+
+==> b1470.par <==
+--maximum-line-length=59
+--indent-columns=9
+--line-up-parentheses
+--variable-maximum-line-length
+--extended-continuation-indentation
+--nowant-left-space='='
+
 ==> b1471.in <==
 my @global_ops = (
     { "|" => sub { $_[0] unless $_[1]; } },
@@ -12117,6 +12133,22 @@ my @global_ops = (
 --want-trailing-commas='*'
 --delete-weld-interfering-commas
 
+==> b1474.in <==
+         $opt = {iparse( {Maxiter => 200, Eps => 1e-4,},
+                           ifhref($opt) )};
+         $opt = {
+                  iparse(  {Maxiter => 200, Eps => 1e-4,}, ifhref($opt) )
+         };
+
+==> b1474.par <==
+--maximum-line-length=59
+--indent-columns=9
+--continuation-indentation=6
+--line-up-parentheses
+--variable-maximum-line-length
+--extended-continuation-indentation
+--brace-tightness=2
+
 ==> b148.in <==
 # state 1
 @yydgoto=(
index 0b4be4940b6d4d11dcb6dfa1d45e1d9e57ae1490..f761d75adcf2172a32f3f7f9621c62004eaf2a9a 100644 (file)
@@ -5701,16 +5701,20 @@ function(
 );
 
 ==> b1266 <==
-        $self->{SUMMARY} =[
-                           {
-                             'descr' => 'Total number of users using the site',
-                             'value' => commify ($total_users)
-                           }
-        ];
+        $self->{SUMMARY} =
+          [
+           {
+              'descr' => 'Total number of users using the site',
+              'value' => commify ($total_users)
+           }
+          ];
 
         $self->{SUMMARY} =
           [
-           { 'descr' => 'Total number of users using the site', 'value' => commify ($total_users) }
+           {
+              'descr' => 'Total number of users using the site',
+              'value' => commify ($total_users)
+           }
           ];
 
 ==> b1267 <==
@@ -8211,6 +8215,15 @@ my @outer =
          ],
         );
 
+==> b1470 <==
+         $opt= {
+                  iparse(  { Maxiter => 200, Eps => 1e-4, }, ifhref($opt) )
+         };
+
+         $opt= {
+                  iparse(  { Maxiter => 200, Eps => 1e-4, }, ifhref($opt) )
+         };
+
 ==> b1471 <==
 my @global_ops = (
     { "|" => sub { $_[0] unless $_[1]; } },
@@ -8222,6 +8235,14 @@ my @global_ops = (
     { "&" => sub { ( $_[0] && $_[1] ) ? $_[0] : 0; } },
 );
 
+==> b1474 <==
+         $opt = {
+                  iparse(  {Maxiter => 200, Eps => 1e-4,}, ifhref($opt) )
+         };
+         $opt = {
+                  iparse(  {Maxiter => 200, Eps => 1e-4,}, ifhref($opt) )
+         };
+
 ==> b148 <==
 # state 1
 @yydgoto=(
index 2d95f03cd22b88b0a14a49c8bb30b23820b9f610..724df054d8b89403499f32f4f90ff3b098e28485 100644 (file)
@@ -2179,29 +2179,9 @@ sub initialize_token_break_preferences {
         $break_before_container_types{'('} = $_ if $_ && $_ > 0;
     }
 
-    #--------------------------------------------------------------
-    # The combination -lp -iob -vmll -bbx=2 can be unstable (b1266)
-    #--------------------------------------------------------------
-    # The -vmll and -lp parameters do not really work well together.
-    # To avoid instabilities, we will change any -bbx=2 to -bbx=1 (stable).
-    # NOTE: we could make this more precise by looking at any exclusion
-    # flags for -lp, and allowing -bbx=2 for excluded types.
-    if (   $rOpts->{'variable-maximum-line-length'}
-        && $rOpts->{'ignore-old-breakpoints'}
-        && $rOpts->{'line-up-parentheses'} )
-    {
-        my @changed;
-        foreach my $key ( keys %break_before_container_types ) {
-            if ( $break_before_container_types{$key} == 2 ) {
-                $break_before_container_types{$key} = 1;
-                push @changed, $key;
-            }
-        }
-        if (@changed) {
+    # Note: a fix for b1266 previously here is now covered by the
+    # updates for b1470, b1474, so it has been removed.
 
-            # we could write a warning here
-        }
-    }
     return;
 } ## end sub initialize_token_break_preferences
 
@@ -27106,6 +27086,11 @@ sub do_colon_breaks {
             # boost tol for combination -lp -xci
             if ($rOpts_extended_continuation_indentation) {
                 $lp_tol_boost = 2;
+
+                # and one more for -lp -xci -vmll (b1470, b1474, b1266)
+                if ($rOpts_variable_maximum_line_length) {
+                    $lp_tol_boost = max( 2, $rOpts_indent_columns );
+                }
             }
 
             # boost tol for combination -lp and any -vtc > 0, but only for