--space-function-paren
--want-trailing-commas='b'
+==> b1433.in <==
+ return (
+ ( $val || !exists $opts{$opt} ) ?
+ do { $opts{$opt} = 1 } :
+ do { delete $opts{$opt}; 1 }
+ );
+
+ return (
+ ( $val || !exists $opts{$opt} ) ? do { $opts{$opt} = 1 }
+ :
+ do { delete $opts{$opt}; 1 }
+ );
+
+==> b1433.par <==
+--break-after-all-operators
+--keep-old-breakpoints-after=':'
+--variable-maximum-line-length
+
+==> b1435.in <==
+(-r _)?do{do$vshnurc;&err($@)}
+ :
+ &err(
+ "Cannot read $vshnurc")
+ if-f$vshnurc;
+
+(-r _)?
+ do{do$vshnurc;&err($@)}:
+ &err(
+ "Cannot read $vshnurc")
+ if-f$vshnurc;
+
+
+==> b1435.par <==
+--noadd-whitespace
+--break-after-all-operators
+--continuation-indentation=7
+--keep-old-breakpoints-after=':'
+--maximum-line-length=34
+
==> b146.in <==
# State 1
return ( $severe_error, $rqw_lines );
} ## end sub resync_lines_and_tokens
+my %is_soft_break_type;
+
+BEGIN {
+
+ # Soft breaks are needed to avoid conflicts for token types which might be
+ # treated with special logic for chains. Fixes b1433, 1434, 1435.
+ # NOTE: $type is used as the hash key for now; if other container tokens
+ # are added it might be necessary to use a token/type mixture.
+ my @q = qw# -> ? : && || + - / * #;
+ @is_soft_break_type{@q} = (1) x scalar(@q);
+
+}
+
sub keep_old_line_breaks {
# Called once per file to find and mark any old line breaks which
if ( !$seqno ) {
my $type = $rLL->[$KK]->[_TYPE_];
if ( $rkeep_break_hash->{$type} ) {
- $rbreak_hash->{$KK} = 1;
+ $rbreak_hash->{$KK} = $is_soft_break_type{$type} ? 2 : 1;
}
}
}
}
}
- $rbreak_hash->{$KK} = 1 if ($match);
+ if ($match) {
+ my $type = $rLL->[$KK]->[_TYPE_];
+ $rbreak_hash->{$KK} = $is_soft_break_type{$type} ? 2 : 1;
+ }
}
}
};