$msg .= " (-pbp contains -st; see manual)" if ($saw_pbp);
Die("$msg\n");
}
- elsif ($destination_stream) {
+
+ if ($destination_stream) {
Die(
"You may not specify a destination array and -o together\n"
);
}
- elsif ( defined( $rOpts->{'output-path'} ) ) {
+
+ if ( defined( $rOpts->{'output-path'} ) ) {
Die("You may not specify -o and -opath together\n");
}
- elsif ( defined( $rOpts->{'output-file-extension'} ) ) {
+
+ if ( defined( $rOpts->{'output-file-extension'} ) ) {
Die("You may not specify -o and -oext together\n");
}
+
$output_file = $rOpts->{outfile};
$output_name = $output_file;
{
$max_iterations = 1;
}
- elsif ( $max_iterations > 6 ) {
+
+ if ( $max_iterations > 6 ) {
$max_iterations = 6;
}
print {*STDERR}
"STRANGE no conv in $display_name: stopping on it=$iter, but not converged in formatter\n";
}
+ else {
+ ## looks ok
+ }
}
# we are stopping the iterations early;
foreach my $opt (@option_string) {
my $long_name = $opt;
$long_name =~ s/(!|=.*|:.*)$//;
- unless ( defined( $option_category{$long_name} ) ) {
+ if ( !defined( $option_category{$long_name} ) ) {
if ( $long_name =~ /^html-linked/ ) {
$category = 10; # HTML options
}
elsif ( $long_name =~ /^pod2html/ ) {
$category = 11; # Pod2html
}
+ else {
+ $category = 12; # HTML properties
+ }
$option_category{$long_name} = $category_name[$category];
}
}
Perl::Tidy::Tokenizer->dump_token_types(*STDOUT);
Exit(0);
}
+ else {
+ ## no more special cases
+ }
}
if ( $saw_dump_profile && $saw_ignore_profile ) {
last;
}
}
+ else {
+ ## done
+ }
# Now store any parameters
if ($body) {
}
# handle case of no quotes
- elsif ( $instr !~ /['"]/ ) {
+ if ( $instr !~ /['"]/ ) {
# We now require a space before the # of a side comment
# this allows something like:
$kwd =~ s/^pod//;
push @args, "--no$kwd";
}
+ else {
+ ## ok - not defined
+ }
}
# "flush",
my $css_string;
my $fh_css = Perl::Tidy::IOScalar->new( \$css_string, 'w' );
- # use css linked to another file
+ # use css linked to another file,
if ( $rOpts->{'html-linked-style-sheet'} ) {
$fh_css->print(
qq(<link rel="stylesheet" href="$css_linkname" type="text/css" />));
}
- # use css embedded in this file
- elsif ( !$rOpts->{'nohtml-style-sheets'} ) {
+ # or no css,
+ elsif ( $rOpts->{'nohtml-style-sheets'} ) {
+
+ }
+
+ # or use css embedded in this file
+ else {
$fh_css->print( <<'ENDCSS');
<style type="text/css">
<!--
$self->add_toc_item( $package, 'package' );
}
}
+ else {
+ ## level unchanged
+ }
${$rlast_level} = $level;
#-------------------------------------------------------
$self->_flush_group_lines(-1);
}
+ else {
+ ##ok: no output needed
+ }
+
# --------------------------------------------------------------------
# Some old debugging stuff
# --------------------------------------------------------------------
$GoToMsg = "Not all tokens match: $imax_align != $jlimit\n";
$return_value = NO_MATCH;
}
+ else {
+ ##ok: continue
+ }
}
}
my $side_comment = $new_line->{'rfields'}->[-1];
end_rgroup(-1) unless ( $side_comment && $prev_comment );
}
+ else {
+ ##ok: continue
+ }
# See if the new line matches and fits the current group,
# if it still exists. Flush the current group if not.
elsif ( $new_line->{'end_group'} ) {
end_rgroup(-1);
}
+
+ else {
+ ##ok: continue
+ }
} ## end loop over lines
end_rgroup(-1);
# spot to take special action on failure to move
}
+ else {
+ ##ok: (move==0)
+ }
}
return;
} ## end sub move_to_common_column
}
# Otherwise allow some minimal padding of good alignments
- elsif (
+ else {
- defined( $is_good_alignment_token{$raw_tok} )
+ if (
- # We have to be careful if there are just 2 lines. This
- # two-line factor allows large gaps only for 2 lines which
- # are simple lists with fewer items on the second line. It
- # gives results similar to previous versions of perltidy.
- && ( $lines_total > 2
- || $group_list_type && $jmax < $jmax_m && $top_level )
- )
- {
- $factor += 1;
- if ($top_level) {
+ defined( $is_good_alignment_token{$raw_tok} )
+
+ # We have to be careful if there are just 2 lines.
+ # This two-line factor allows large gaps only for 2
+ # lines which are simple lists with fewer items on the
+ # second line. It gives results similar to previous
+ # versions of perltidy.
+ && (
+ $lines_total > 2
+ || ( $group_list_type
+ && $jmax < $jmax_m
+ && $top_level )
+ )
+ )
+ {
$factor += 1;
+ if ($top_level) {
+ $factor += 1;
+ }
}
}
if ($match_code) {
if ( $match_code == 1 ) { $i_nomatch = $i }
elsif ( $match_code == 2 ) { $i_nomatch = 0 }
+ else { } ##ok
last;
}
}
$is_marginal = $pat0 ne $pat1;
}
}
+ else {
+ ##ok: (none of the above)
+ }
#-----------------------------------------------------
# Turn off the marginal flag if we saw an 'if' or 'or'