## 2022 06 13.02
+ - Fix for issue git #105, incorrect formatting with 5.36 experimental
+ for_list feature.
+
- Fix for issue git #103. For parameter -b, or --backup-and-modify-in-place,
the default backup method has been changed to preserve the inode value
of the file being formatted. If this causes a problem, the previous
} ## end else [ if ( $last_last_nonblank_token...
} ## end if ( $expecting == OPERATOR...
}
- $paren_type[$paren_depth] = $container_type;
+
+ # Do not update container type at ') ('; fix for git #105. This will
+ # propagate the container type onward so that any subsequent brace gets
+ # correctly marked. I have implemented this as a general rule, which
+ # should be safe, but if necessary it could be restricted to certain
+ # container statement types such as 'for'.
+ $paren_type[$paren_depth] = $container_type
+ if ( $last_nonblank_token ne ')' );
+
( $type_sequence, $indent_flag ) =
increase_nesting_depth( PAREN, $rtoken_map->[$i_tok] );
--- /dev/null
+use v5.36;
+
+use experimental 'for_list';
+
+for my ( $k, $v ) ( 1, 2, 3, 4 ) {
+ say "$k:$v";
+}
+say 'end';
+
--- /dev/null
+use v5.36;
+
+use experimental 'for_list';
+
+for my ( $k, $v ) ( 1, 2, 3, 4 ) {
+ say "$k:$v";
+}
+say 'end';
+
../snippets26.t git93.def
../snippets26.t git93.git93
../snippets26.t c139.def
+../snippets26.t drc.def
+../snippets26.t drc.drc
../snippets3.t ce_wn1.ce_wn
../snippets3.t ce_wn1.def
../snippets3.t colin.colin
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
-../snippets26.t drc.def
-../snippets26.t drc.drc
+../snippets26.t git105.def
#8 c139.def
#9 drc.def
#10 drc.drc
+#11 git105.def
# To locate test #13 you can search for its name or the string '#13'
'drc' => <<'----------',
ignoreSpec( $file, "file",, \%spec,,, \%Rspec );
+----------
+
+ 'git105' => <<'----------',
+use v5.36;
+
+use experimental 'for_list';
+
+for my ( $k, $v ) ( 1, 2, 3, 4 ) {
+ say "$k:$v";
+}
+say 'end';
+
----------
'git93' => <<'----------',
ignoreSpec( $file, "file", \%spec, \%Rspec );
#10...........
},
+
+ 'git105.def' => {
+ source => "git105",
+ params => "def",
+ expect => <<'#11...........',
+use v5.36;
+
+use experimental 'for_list';
+
+for my ( $k, $v ) ( 1, 2, 3, 4 ) {
+ say "$k:$v";
+}
+say 'end';
+
+#11...........
+ },
};
my $ntests = 0 + keys %{$rtests};