From: Steve Hancock Date: Thu, 2 Mar 2023 02:03:57 +0000 (-0800) Subject: update closing side comments X-Git-Tag: 20230309~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0bcb226ad86ad5187b7fe6d5f49d65c605f29bc6;p=perltidy.git update closing side comments --- diff --git a/lib/Perl/Tidy.pm b/lib/Perl/Tidy.pm index b5f93a13..1093b786 100644 --- a/lib/Perl/Tidy.pm +++ b/lib/Perl/Tidy.pm @@ -114,7 +114,7 @@ BEGIN { # a release anyway. $VERSION = '20221112.05'; -} +} ## end BEGIN sub DESTROY { @@ -470,7 +470,7 @@ BEGIN { _input_copied_verbatim_ => $i++, _input_output_difference_ => $i++, }; -} +} ## end BEGIN sub perltidy { @@ -635,14 +635,14 @@ EOM if ($flag) { goto ERROR_EXIT } else { goto NORMAL_EXIT } croak "unexpectd return to Exit"; - } + } ## end sub Exit sub Die { my $msg = shift; Warn($msg); Exit(1); croak "unexpected return to Die"; - } + } ## end sub Die sub Fault { my ($msg) = @_; @@ -672,7 +672,7 @@ EOM # This return is to keep Perl-Critic from complaining. return; - } + } ## end sub Fault # extract various dump parameters my $dump_options_type = $input_hash{'dump_options_type'}; @@ -1128,7 +1128,7 @@ sub check_in_place_modify { } return ( $in_place_modify, $backup_extension, $delete_backup ); -} +} ## end sub check_in_place_modify sub backup_method_copy { @@ -2962,7 +2962,7 @@ sub fileglob_to_re { $x =~ s#\*#.*#g; # '*' -> '.*' $x =~ s#\?#.#g; # '?' -> '.' return "^$x\\z"; # match whole word -} +} ## end sub fileglob_to_re sub make_logfile_header { my ( $rOpts, $config_file, $rraw_options, $Windows_type, $readable_options ) @@ -4273,7 +4273,7 @@ sub cleanup_word_list { } $rOpts->{$option_name} = join SPACE, @filtered_word_list; return \%seen; -} +} ## end sub cleanup_word_list sub check_options { @@ -4793,7 +4793,7 @@ sub is_unix { && ( $OSNAME ne 'VMS' ) && ( $OSNAME ne 'OS2' ) && ( $OSNAME ne 'MacOS' ); -} +} ## end sub is_unix sub look_for_Windows { @@ -5278,7 +5278,7 @@ sub dump_defaults { print STDOUT "Default command line options:\n"; foreach my $line ( sort @defaults ) { print STDOUT "$line\n" } return; -} +} ## end sub dump_defaults sub readable_options { diff --git a/lib/Perl/Tidy/Debugger.pm b/lib/Perl/Tidy/Debugger.pm index 8ec11f08..fa89f9a0 100644 --- a/lib/Perl/Tidy/Debugger.pm +++ b/lib/Perl/Tidy/Debugger.pm @@ -23,7 +23,7 @@ sub new { _fh => undef, _is_encoded_data => $is_encoded_data, }, $class; -} +} ## end sub new sub really_open_debug_file { @@ -40,7 +40,7 @@ sub really_open_debug_file { $fh->print( "Use -dump-token-types (-dtt) to get a list of token type codes\n"); return; -} +} ## end sub really_open_debug_file sub close_debug_file { @@ -52,7 +52,7 @@ sub close_debug_file { } } return; -} +} ## end sub close_debug_file sub write_debug_entry { @@ -116,5 +116,5 @@ sub write_debug_entry { $fh->print("$token_str\n"); return; -} +} ## end sub write_debug_entry 1; diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 216ee2c5..6f1dc96d 100644 --- a/lib/Perl/Tidy/FileWriter.pm +++ b/lib/Perl/Tidy/FileWriter.pm @@ -31,7 +31,7 @@ This error is probably due to a recent programming change ====================================================================== EOM exit 1; -} +} ## end sub AUTOLOAD sub DESTROY { @@ -71,7 +71,7 @@ BEGIN { _K_last_arrival_ => $i++, _save_logfile_ => $i++, }; -} +} ## end BEGIN sub Die { my ($msg) = @_; @@ -105,14 +105,14 @@ EOM # This return is to keep Perl-Critic from complaining. return; -} +} ## end sub Fault sub warning { my ( $self, $msg ) = @_; my $logger_object = $self->[_logger_object_]; if ($logger_object) { $logger_object->warning($msg); } return; -} +} ## end sub warning sub write_logfile_entry { my ( $self, $msg ) = @_; @@ -121,7 +121,7 @@ sub write_logfile_entry { $logger_object->write_logfile_entry($msg); } return; -} +} ## end sub write_logfile_entry sub new { my ( $class, $line_sink_object, $rOpts, $logger_object ) = @_; @@ -157,7 +157,7 @@ sub new { bless $self, $class; return $self; -} +} ## end sub new sub setup_convergence_test { my ( $self, $rlist ) = @_; @@ -175,7 +175,7 @@ sub setup_convergence_test { $self->[_K_sequence_error_msg_] = EMPTY_STRING; $self->[_K_last_arrival_] = -1; return; -} +} ## end sub setup_convergence_test sub get_convergence_check { my ($self) = @_; @@ -183,7 +183,7 @@ sub get_convergence_check { # converged if all K arrived and in correct order return $self->[_K_arrival_order_matches_] && !@{$rlist}; -} +} ## end sub get_convergence_check sub get_output_line_number { return $_[0]->[_output_line_number_]; @@ -221,7 +221,7 @@ sub want_blank_line { $self->write_blank_code_line(); } return; -} +} ## end sub want_blank_line sub require_blank_code_lines { @@ -236,7 +236,7 @@ sub require_blank_code_lines { $self->write_blank_code_line($forced); } return; -} +} ## end sub require_blank_code_lines sub write_blank_code_line { my ( $self, $forced ) = @_; @@ -268,7 +268,7 @@ sub write_blank_code_line { $self->[_consecutive_new_blank_lines_]++ if ($forced); return; -} +} ## end sub write_blank_code_line use constant MAX_PRINTED_CHARS => 80; @@ -341,7 +341,7 @@ EOM $self->[_K_last_arrival_] = $K; } return; -} +} ## end sub write_code_line sub write_line { my ( $self, $str ) = @_; @@ -354,7 +354,7 @@ sub write_line { if ( $self->[_save_logfile_] ) { $self->check_line_lengths($str) } return; -} +} ## end sub write_line sub check_line_lengths { my ( $self, $str ) = @_; @@ -400,7 +400,7 @@ sub check_line_lengths { $self->[_line_length_error_count_]++; } return; -} +} ## end sub check_line_lengths sub report_line_length_errors { my $self = shift; @@ -448,5 +448,5 @@ sub report_line_length_errors { } } return; -} +} ## end sub report_line_length_errors 1; diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index b5742f06..94efcad9 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -446,7 +446,7 @@ BEGIN { # Number of token variables; must be last in list: _NVARS => $i++, }; -} +} ## end BEGIN BEGIN { @@ -570,7 +570,7 @@ BEGIN { _LAST_SELF_INDEX_ => $i - 1, }; -} +} ## end BEGIN BEGIN { @@ -592,7 +592,7 @@ BEGIN { _ri_starting_one_line_block_ => $i++, _runmatched_opening_indexes_ => $i++, }; -} +} ## end BEGIN BEGIN { @@ -823,7 +823,7 @@ BEGIN { push @obf, ','; @is_other_brace_follower{@obf} = (1) x scalar(@obf); -} +} ## end BEGIN { ## begin closure to count instances @@ -1199,7 +1199,7 @@ sub check_token_array { ); @valid_line_hash{@valid_line_keys} = (1) x scalar(@valid_line_keys); - } + } ## end BEGIN sub check_line_hashes { my $self = shift; @@ -1233,7 +1233,7 @@ sub check_token_array { $input_stream_name = $logger_object->get_input_stream_name(); } return $input_stream_name; - } + } ## end sub get_input_stream_name # interface to Perl::Tidy::Logger routines sub warning { @@ -1248,7 +1248,7 @@ sub check_token_array { $logger_object->complain($msg); } return; - } + } ## end sub complain sub write_logfile_entry { my @msg = @_; @@ -1256,21 +1256,21 @@ sub check_token_array { $logger_object->write_logfile_entry(@msg); } return; - } + } ## end sub write_logfile_entry sub get_saw_brace_error { if ($logger_object) { return $logger_object->get_saw_brace_error(); } return; - } + } ## end sub get_saw_brace_error sub we_are_at_the_last_line { if ($logger_object) { $logger_object->we_are_at_the_last_line(); } return; - } + } ## end sub we_are_at_the_last_line } ## end closure for logger routines @@ -1289,7 +1289,7 @@ sub check_token_array { $diagnostics_object->write_diagnostics($msg); } return; - } + } ## end sub write_diagnostics } ## end closure for diagnostics routines sub get_convergence_check { @@ -1309,7 +1309,7 @@ sub want_blank_line { my $file_writer_object = $self->[_file_writer_object_]; $file_writer_object->want_blank_line(); return; -} +} ## end sub want_blank_line sub write_unindented_line { my ( $self, $line ) = @_; @@ -1317,7 +1317,7 @@ sub write_unindented_line { my $file_writer_object = $self->[_file_writer_object_]; $file_writer_object->write_line($line); return; -} +} ## end sub write_unindented_line sub consecutive_nonblank_lines { my ($self) = @_; @@ -1325,7 +1325,7 @@ sub consecutive_nonblank_lines { my $vao = $self->[_vertical_aligner_object_]; return $file_writer_object->get_consecutive_nonblank_lines() + $vao->get_cached_line_count(); -} +} ## end sub consecutive_nonblank_lines sub split_words { @@ -2145,7 +2145,7 @@ sub initialize_space_after_keyword { } return; -} +} ## end sub initialize_space_after_keyword sub initialize_token_break_preferences { @@ -2834,7 +2834,7 @@ BEGIN { @q = qw( w i ); @is_wi{@q} = (1) x scalar(@q); -} +} ## end BEGIN use constant DEBUG_WHITE => 0; @@ -3613,7 +3613,7 @@ EOM qw{ ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ }; @{is_special_variable_char}{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub is_essential_whitespace { @@ -3875,7 +3875,7 @@ EOM my $tok = $value->[0]; push @{ $is_leading_secret_token{$tok} }, $value; } - } + } ## end BEGIN sub new_secret_operator_whitespace { @@ -4939,7 +4939,7 @@ sub bad_pattern { my ($pattern) = @_; my $ok = eval "'##'=~/$pattern/"; return !defined($ok) || $EVAL_ERROR; -} +} ## end sub bad_pattern { ## begin closure prepare_cuddled_block_types @@ -6205,7 +6205,7 @@ sub find_loop_label { @q = (qw( and or xor if else elsif unless until while for foreach )); @is_mccabe_logic_keyword{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub find_mccabe_count { my ($self) = @_; @@ -7128,7 +7128,7 @@ sub dump_verbatim { $self->write_unindented_line($input_line); } return; -} +} ## end sub dump_verbatim my %wU; my %wiq; @@ -7170,7 +7170,7 @@ BEGIN { @q = qw( = == != ); @is_unexpected_equals{@q} = (1) x scalar(@q); -} +} ## end BEGIN { #<<< begin clousure respace_tokens @@ -8713,7 +8713,7 @@ sub delete_weld_interfering_comma { } return; -} ## end sub delete_trailing_comma +} ## end sub delete_weld_interfering_comma sub unstore_last_nonblank_token { @@ -8776,7 +8776,7 @@ sub unstore_last_nonblank_token { } } return 1; -} +} ## end sub unstore_last_nonblank_token sub match_trailing_comma_rule { @@ -9003,7 +9003,7 @@ sub match_trailing_comma_rule { } } return $match; -} +} ## end sub match_trailing_comma_rule sub store_new_token { @@ -9431,7 +9431,7 @@ sub is_list_by_K { my $parent_seqno = $self->parent_seqno_by_K($KK); return unless defined($parent_seqno); return $self->[_ris_list_by_seqno_]->{$parent_seqno}; -} +} ## end sub is_list_by_K sub is_list_by_seqno { @@ -9440,7 +9440,7 @@ sub is_list_by_seqno { my ( $self, $seqno ) = @_; return unless defined($seqno); return $self->[_ris_list_by_seqno_]->{$seqno}; -} +} ## end sub is_list_by_seqno sub resync_lines_and_tokens { @@ -9673,7 +9673,7 @@ sub check_for_old_break { } } return; -} +} ## end sub check_for_old_break sub keep_old_line_breaks { @@ -10342,7 +10342,7 @@ BEGIN { # these types do not 'like' to be separated from a following paren @q = qw(w i q Q G C Z U); @{has_tight_paren}{@q} = (1) x scalar(@q); -} +} ## end BEGIN use constant DEBUG_WELD => 0; @@ -12668,7 +12668,7 @@ BEGIN { _K_c_ => $i++, _interrupted_list_rule_ => $i++, }; -} +} ## end BEGIN sub is_fragile_block_type { my ( $self, $block_type, $seqno ) = @_; @@ -12724,7 +12724,7 @@ sub is_fragile_block_type { ]; return; - } + } ## end sub xlp_collapsed_lengths_initialize sub cumulative_length_to_comma { my ( $self, $KK, $K_comma, $K_closing ) = @_; @@ -14355,7 +14355,7 @@ EOM $next_parent_seqno = SEQ_ROOT; $next_slevel = undef; return; - } + } ## end sub initialize_process_line_of_CODE # Batch variables: these describe the current batch of code being formed # and sent down the pipeline. They are initialized in the next @@ -14445,7 +14445,7 @@ EOM # call with no args to delete the current one-line block ($index_start_one_line_block) = @_; return; - } + } ## end sub create_one_line_block # Routine to place the current token into the output stream. # Called once per output token. @@ -14785,7 +14785,7 @@ EOM my $vao = $self->[_vertical_aligner_object_]; $vao->flush(); return; - } + } ## end sub flush_vertical_aligner # flush is called to output any tokens in the pipeline, so that # an alternate source of lines can be written in the correct order @@ -16374,7 +16374,7 @@ sub compare_indentation_levels { push @q, ','; @break_before_or_after_token{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub set_fake_breakpoint { @@ -16383,7 +16383,7 @@ sub compare_indentation_levels { # where to make them. $forced_breakpoint_count++; return; - } + } ## end sub set_fake_breakpoint use constant DEBUG_FORCE => 0; @@ -16647,7 +16647,7 @@ EOM $batch_count = 0; %saved_opening_indentation = (); return; - } + } ## end sub initialize_grind_batch_of_CODE # sub grind_batch_of_CODE receives sections of code which are the longest # possible lines without a break. In other words, it receives what is left @@ -17326,7 +17326,7 @@ EOM $summed_lengths_to_go[ $_ + 1 ] += $tok_len; } return; - } + } ## end sub unmask_phantom_token sub save_opening_indentation { @@ -17758,7 +17758,7 @@ EOM # : "$str" push @q, qw( or || ? : ); @{$ris_break_token}{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub in_same_container_i { @@ -17958,7 +17958,7 @@ sub break_equals { @q = qw( * / ); @is_mult_div{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub Debug_dump_breakpoints { @@ -19450,7 +19450,7 @@ EOM return if ( $tv > 2 ); } return 1; - } + } ## end sub simple_rhs sub recombine_section_3 { @@ -21117,7 +21117,7 @@ sub do_colon_breaks { $self->insert_additional_breaks( \@insert_list, $ri_first, $ri_last ); } return; -} +} ## end sub do_colon_breaks ########################################### # CODE SECTION 11: Code to break long lists @@ -21369,7 +21369,7 @@ sub do_colon_breaks { my @q = qw< k R } ) ] Y Z U w i q Q . = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=>; @is_uncontained_comma_break_included_type{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub do_uncontained_comma_breaks { @@ -21539,7 +21539,7 @@ EOM push @q, ','; push @q, 'f'; # added for ';' for issue c154 @quick_filter{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub set_for_semicolon_breakpoints { my ( $self, $dd ) = @_; @@ -21547,7 +21547,7 @@ EOM $self->set_forced_breakpoint($_); } return; - } + } ## end sub set_for_semicolon_breakpoints sub set_logical_breakpoints { my ( $self, $dd ) = @_; @@ -21586,7 +21586,7 @@ EOM # because bad things can happen (map1.t) my $dd = shift; return $is_sort_map_grep{ $container_type[$dd] }; - } + } ## end sub is_unbreakable_container sub break_lists { @@ -22048,7 +22048,7 @@ EOM @q = qw(eq ne le ge lt gt); @{poor_keywords}{@q} = (1) x scalar(@q); @{poor_next_keywords}{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub examine_old_breakpoint { @@ -22900,7 +22900,7 @@ BEGIN { @q = qw<( [ { L R } ] ) = b>; push @q, ','; @is_key_type{@q} = (1) x scalar(@q); -} +} ## end BEGIN use constant DEBUG_FIND_START => 0; @@ -22987,7 +22987,7 @@ EOM unshift ); @is_keyword_with_special_leading_term{@q} = (1) x scalar(@q); - } + } ## end BEGIN use constant DEBUG_SPARSE => 0; @@ -23146,7 +23146,7 @@ EOM $self->set_forced_breakpoint($i_true_last_comma); } return; - } + } ## end sub apply_broken_sublist_rule sub set_emergency_comma_breakpoints { @@ -23245,7 +23245,7 @@ EOM # let breaks be defined by default bond strength logic } return; - } + } ## end sub set_emergency_comma_breakpoints sub break_multiline_list { my ( $self, $rhash_IN, $rhash_A, $i_opening_minus ) = @_; @@ -24333,7 +24333,7 @@ sub copy_old_breakpoints { } } return; -} +} ## end sub copy_old_breakpoints sub set_nobreaks { my ( $self, $i, $j ) = @_; @@ -24433,7 +24433,7 @@ sub get_spaces { # with a get_spaces method. my $indentation = shift; return ref($indentation) ? $indentation->get_spaces() : $indentation; -} +} ## end sub get_spaces sub get_recoverable_spaces { @@ -24442,7 +24442,7 @@ sub get_recoverable_spaces { # to get them to line up with their opening parens my $indentation = shift; return ref($indentation) ? $indentation->get_recoverable_spaces() : 0; -} +} ## end sub get_recoverable_spaces sub get_available_spaces_to_go { @@ -24480,7 +24480,7 @@ sub get_available_spaces_to_go { _lp_container_seqno_ => $i++, _lp_space_count_ => $i++, }; - } + } ## end BEGIN sub initialize_lp_vars { @@ -24522,7 +24522,7 @@ sub get_available_spaces_to_go { @hash_test2{@q} = (1) x scalar(@q); @q = qw( . || && ); @hash_test3{@q} = (1) x scalar(@q); - } + } ## end BEGIN # shared variables, re-initialized for each batch my $rlp_object_list; @@ -26228,7 +26228,7 @@ EOM # eq and ne were removed from this list to improve alignment chances @q = qw(if unless and or err for foreach while until); @is_vertical_alignment_keyword{@q} = (1) x scalar(@q); - } + } ## end BEGIN my $ralignment_type_to_go; my $ralignment_counts; @@ -27611,7 +27611,7 @@ sub xlp_tweak { } return; -} +} ## end sub xlp_tweak { ## begin closure make_alignment_patterns @@ -27693,7 +27693,7 @@ sub xlp_tweak { ##'is_deeply' => 'is', # poor; names lengths too different ); - } + } ## end BEGIN sub make_alignment_patterns { @@ -28254,7 +28254,7 @@ sub make_paren_name { $last_unadjusted_indentation = 0; $last_leading_token = EMPTY_STRING; return; - } + } ## end sub initialize_get_final_indentation sub get_final_indentation { @@ -29152,7 +29152,7 @@ sub make_paren_name { $opening_exists, ); - } + } ## end sub get_closing_token_indentation } ## end closure get_final_indentation sub get_opening_indentation { @@ -29255,7 +29255,7 @@ sub examine_vertical_tightness_flags { # we can skip all calls to sub set_vertical_tightness_flags $self->[_no_vertical_tightness_flags_] = 1; return; -} +} ## end sub examine_vertical_tightness_flags sub set_vertical_tightness_flags { @@ -30131,7 +30131,7 @@ sub set_vertical_tightness_flags { ')' => '(', ']' => '[', ); - } + } ## end BEGIN sub balance_csc_text { diff --git a/lib/Perl/Tidy/HtmlWriter.pm b/lib/Perl/Tidy/HtmlWriter.pm index c8d75560..ecd940ad 100644 --- a/lib/Perl/Tidy/HtmlWriter.pm +++ b/lib/Perl/Tidy/HtmlWriter.pm @@ -40,7 +40,7 @@ BEGIN { if ( !eval { require Pod::Html; 1 } ) { $missing_pod_html = $EVAL_ERROR ? $EVAL_ERROR : 1; } -} +} ## end BEGIN sub AUTOLOAD { @@ -61,7 +61,7 @@ This error is probably due to a recent programming change ====================================================================== EOM exit 1; -} +} ## end sub AUTOLOAD sub DESTROY { @@ -196,7 +196,7 @@ PRE_END # name changes _rlast_level => \$last_level, # brace indentation level }, $class; -} +} ## end sub new sub close_object { my ($object) = @_; @@ -204,7 +204,7 @@ sub close_object { # returns true if close works, false if not # failure probably means there is no close method return eval { $object->close(); 1 }; -} +} ## end sub close_object sub add_toc_item { @@ -313,7 +313,7 @@ TOC_END TOC_END } return; -} +} ## end sub add_toc_item BEGIN { @@ -419,7 +419,7 @@ BEGIN { # my @list = qw" .. -> <> ... \ ? "; # @token_long_names{@list} = ('misc-operators') x scalar(@list); -} +} ## end BEGIN sub make_getopt_long_names { my ( $class, $rgetopt_names ) = @_; @@ -459,7 +459,7 @@ sub make_getopt_long_names { push @{$rgetopt_names}, "podheader!"; push @{$rgetopt_names}, "podindex!"; return; -} +} ## end sub make_getopt_long_names sub make_abbreviated_names { @@ -496,7 +496,7 @@ sub make_abbreviated_names { ${$rexpansion}{"text"} = ["html-toc-extension"]; ${$rexpansion}{"sext"} = ["html-src-extension"]; return; -} +} ## end sub make_abbreviated_names sub check_options { @@ -585,7 +585,7 @@ sub check_options { } $missing_html_entities = 1 unless $rOpts->{'html-entities'}; return; -} +} ## end sub check_options sub write_style_sheet_file { @@ -597,7 +597,7 @@ sub write_style_sheet_file { write_style_sheet_data($fh); close_object($fh); return; -} +} ## end sub write_style_sheet_file sub write_style_sheet_data { @@ -640,7 +640,7 @@ EOM $fh->print("} /* $long_name */\n"); } return; -} +} ## end sub write_style_sheet_data sub set_default_color { @@ -649,7 +649,7 @@ sub set_default_color { if ( $rOpts->{$key} ) { $color = $rOpts->{$key} } $rOpts->{$key} = check_RGB($color); return; -} +} ## end sub set_default_color sub check_RGB { @@ -658,7 +658,7 @@ sub check_RGB { my ($color) = @_; if ( $color =~ /^[0-9a-fA-F]{6,6}$/ ) { $color = "#$color" } return $color; -} +} ## end sub check_RGB sub set_default_properties { my ( $short_name, $color, $bold, $italic ) = @_; @@ -670,7 +670,7 @@ sub set_default_properties { $key = "html-italic-$short_to_long_names{$short_name}"; $rOpts->{$key} = ( defined $rOpts->{$key} ) ? $rOpts->{$key} : $italic; return; -} +} ## end sub set_default_properties sub pod_to_html { @@ -965,7 +965,7 @@ sub pod_to_html { $self->make_frame( \@toc ); } return $success_flag; -} +} ## end sub pod_to_html sub make_frame { @@ -1012,7 +1012,7 @@ sub make_frame { $toc_basename, $src_basename, $src_frame_name ); return; -} +} ## end sub make_frame sub write_toc_html { @@ -1039,7 +1039,7 @@ EOM EOM return; -} +} ## end sub write_toc_html sub write_frame_html { @@ -1096,7 +1096,7 @@ EOM EOM return; -} +} ## end sub write_frame_html sub change_anchor_names { @@ -1120,7 +1120,7 @@ sub change_anchor_names { } } return $first_anchor; -} +} ## end sub change_anchor_names sub close_html_file { my $self = shift; @@ -1267,7 +1267,7 @@ HTML_END $self->make_frame( \@toc ); } return; -} +} ## end sub close_html_file sub markup_tokens { my ( $self, $rtokens, $rtoken_type, $rlevels ) = @_; @@ -1343,7 +1343,7 @@ sub markup_tokens { push @colored_tokens, $token; } return ( \@colored_tokens ); -} +} ## end sub markup_tokens sub markup_html_element { my ( $self, $token, $type ) = @_; @@ -1376,7 +1376,7 @@ sub markup_html_element { if ( $html_bold{$short_name} ) { $token = "$token" } } return $token; -} +} ## end sub markup_html_element sub escape_html { @@ -1391,7 +1391,7 @@ sub escape_html { HTML::Entities::encode_entities($token); } return $token; -} +} ## end sub escape_html sub finish_formatting { @@ -1399,7 +1399,7 @@ sub finish_formatting { my $self = shift; $self->close_html_file(); return; -} +} ## end sub finish_formatting sub write_line { @@ -1510,5 +1510,5 @@ EOM # write the line $html_pre_fh->print("$html_line\n"); return; -} +} ## end sub write_line 1; diff --git a/lib/Perl/Tidy/IndentationItem.pm b/lib/Perl/Tidy/IndentationItem.pm index 71a253e0..c1c788ae 100644 --- a/lib/Perl/Tidy/IndentationItem.pm +++ b/lib/Perl/Tidy/IndentationItem.pm @@ -1,6 +1,6 @@ ##################################################################### # -# the Perl::Tidy::IndentationItem class supplies items which contain +# The Perl::Tidy::IndentationItem class supplies items which contain # how much whitespace should be used at the start of a line # ##################################################################### @@ -33,7 +33,7 @@ BEGIN { _standard_spaces_ => $i++, _K_extra_space_ => $i++, }; -} +} ## end BEGIN sub AUTOLOAD { @@ -54,7 +54,7 @@ This error is probably due to a recent programming change ====================================================================== EOM exit 1; -} +} ## end sub AUTOLOAD sub DESTROY { @@ -107,7 +107,7 @@ sub new { bless $self, $class; return $self; -} +} ## end sub new sub permanently_decrease_available_spaces { @@ -131,7 +131,7 @@ sub permanently_decrease_available_spaces { $item->set_recoverable_spaces(0); return $deleted_spaces; -} +} ## end sub permanently_decrease_available_spaces sub tentatively_decrease_available_spaces { @@ -149,7 +149,7 @@ sub tentatively_decrease_available_spaces { $item->decrease_SPACES($deleted_spaces); $item->increase_recoverable_spaces($deleted_spaces); return $deleted_spaces; -} +} ## end sub tentatively_decrease_available_spaces sub get_stack_depth { return $_[0]->[_stack_depth_]; @@ -173,7 +173,7 @@ sub set_marked { $self->[_marked_] = $value; } return $self->[_marked_]; -} +} ## end sub set_marked sub get_available_spaces { return $_[0]->[_available_spaces_]; @@ -185,7 +185,7 @@ sub decrease_SPACES { $self->[_spaces_] -= $value; } return $self->[_spaces_]; -} +} ## end sub decrease_SPACES sub decrease_available_spaces { my ( $self, $value ) = @_; @@ -194,7 +194,7 @@ sub decrease_available_spaces { $self->[_available_spaces_] -= $value; } return $self->[_available_spaces_]; -} +} ## end sub decrease_available_spaces sub get_align_seqno { return $_[0]->[_align_seqno_]; @@ -210,7 +210,7 @@ sub set_recoverable_spaces { $self->[_recoverable_spaces_] = $value; } return $self->[_recoverable_spaces_]; -} +} ## end sub set_recoverable_spaces sub increase_recoverable_spaces { my ( $self, $value ) = @_; @@ -218,7 +218,7 @@ sub increase_recoverable_spaces { $self->[_recoverable_spaces_] += $value; } return $self->[_recoverable_spaces_]; -} +} ## end sub increase_recoverable_spaces sub get_ci_level { return $_[0]->[_ci_level_]; @@ -251,7 +251,7 @@ sub set_have_child { $self->[_have_child_] = $value; } return $self->[_have_child_]; -} +} ## end sub set_have_child sub get_have_child { return $_[0]->[_have_child_]; @@ -263,7 +263,7 @@ sub set_arrow_count { $self->[_arrow_count_] = $value; } return $self->[_arrow_count_]; -} +} ## end sub set_arrow_count sub get_arrow_count { return $_[0]->[_arrow_count_]; @@ -275,7 +275,7 @@ sub set_comma_count { $self->[_comma_count_] = $value; } return $self->[_comma_count_]; -} +} ## end sub set_comma_count sub get_comma_count { return $_[0]->[_comma_count_]; @@ -287,7 +287,7 @@ sub set_closed { $self->[_closed_] = $value; } return $self->[_closed_]; -} +} ## end sub set_closed sub get_closed { return $_[0]->[_closed_]; diff --git a/lib/Perl/Tidy/Logger.pm b/lib/Perl/Tidy/Logger.pm index e8d47e81..0b3d49fb 100644 --- a/lib/Perl/Tidy/Logger.pm +++ b/lib/Perl/Tidy/Logger.pm @@ -34,7 +34,7 @@ This error is probably due to a recent programming change ====================================================================== EOM exit 1; -} +} ## end sub AUTOLOAD sub DESTROY { @@ -108,7 +108,7 @@ sub new { _filename_stamp => $filename_stamp, _save_logfile => $rOpts->{'logfile'}, }, $class; -} +} ## end sub new sub get_input_stream_name { my $self = shift; @@ -143,14 +143,14 @@ sub interrupt_logfile { $self->warning("\n"); $self->write_logfile_entry( '#' x 24 . " WARNING " . '#' x 25 . "\n" ); return; -} +} ## end sub interrupt_logfile sub resume_logfile { my $self = shift; $self->write_logfile_entry( '#' x 60 . "\n" ); $self->{_use_prefix} = 1; return; -} +} ## end sub resume_logfile sub we_are_at_the_last_line { my $self = shift; @@ -159,7 +159,7 @@ sub we_are_at_the_last_line { } $self->{_at_end_of_file} = 1; return; -} +} ## end sub we_are_at_the_last_line # record some stuff in case we go down in flames use constant MAX_PRINTED_CHARS => 35; @@ -198,7 +198,7 @@ sub black_box { $self->logfile_output( EMPTY_STRING, "$out_str\n" ); } return; -} +} ## end sub black_box sub write_logfile_entry { @@ -207,7 +207,7 @@ sub write_logfile_entry { # add leading >>> to avoid confusing error messages and code $self->logfile_output( ">>>", "@msg" ); return; -} +} ## end sub write_logfile_entry sub write_column_headings { my $self = shift; @@ -226,7 +226,7 @@ lines levels i k (code begins with one '.' per indent level) ------ ----- - - -------- ------------------------------------------- EOM return; -} +} ## end sub write_column_headings sub make_line_information_string { @@ -280,7 +280,7 @@ sub make_line_information_string { "L$input_line_number:$output_line_number$extra_space i$guessed_indentation_level:$structural_indentation_level $ci_level $bk $nesting_string"; } return $line_information_string; -} +} ## end sub make_line_information_string sub logfile_output { my ( $self, $prompt, $msg ) = @_; @@ -302,7 +302,7 @@ sub logfile_output { } } return; -} +} ## end sub logfile_output sub get_saw_brace_error { my $self = shift; @@ -331,7 +331,7 @@ sub brace_warning { $self->warning("No further warnings of this type will be given\n"); } return; -} +} ## end sub brace_warning sub complain { @@ -350,7 +350,7 @@ sub complain { $self->write_logfile_entry($msg); } return; -} +} ## end sub complain sub warning { @@ -440,7 +440,7 @@ sub warning { } } return; -} +} ## end sub warning sub report_definite_bug { my $self = shift; @@ -454,7 +454,7 @@ sub get_save_logfile { # the logfile will be saved. my $self = shift; return $self->{_save_logfile}; -} +} ## end sub get_save_logfile sub finish { @@ -502,5 +502,5 @@ sub finish { } } return; -} +} ## end sub finish 1; diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index abb3305e..6198b1fa 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -209,7 +209,7 @@ BEGIN { _rOpts_logfile_ => $i++, _rOpts_ => $i++, }; -} +} ## end BEGIN { ## closure for subs to count instances @@ -292,7 +292,7 @@ sub bad_pattern { my ($pattern) = @_; my $ok = eval "'##'=~/$pattern/"; return !defined($ok) || $EVAL_ERROR; -} +} ## end sub bad_pattern sub make_code_skipping_pattern { my ( $rOpts, $opt_name, $default ) = @_; @@ -535,7 +535,7 @@ sub warning { $logger_object->warning($msg); } return; -} +} ## end sub warning sub get_input_stream_name { my $input_stream_name = EMPTY_STRING; @@ -544,7 +544,7 @@ sub get_input_stream_name { $input_stream_name = $logger_object->get_input_stream_name(); } return $input_stream_name; -} +} ## end sub get_input_stream_name sub complain { my $msg = shift; @@ -564,7 +564,7 @@ sub write_logfile_entry { $logger_object->write_logfile_entry($msg); } return; -} +} ## end sub write_logfile_entry sub interrupt_logfile { my $logger_object = $tokenizer_self->[_logger_object_]; @@ -572,7 +572,7 @@ sub interrupt_logfile { $logger_object->interrupt_logfile(); } return; -} +} ## end sub interrupt_logfile sub resume_logfile { my $logger_object = $tokenizer_self->[_logger_object_]; @@ -580,7 +580,7 @@ sub resume_logfile { $logger_object->resume_logfile(); } return; -} +} ## end sub resume_logfile sub increment_brace_error { my $logger_object = $tokenizer_self->[_logger_object_]; @@ -588,7 +588,7 @@ sub increment_brace_error { $logger_object->increment_brace_error(); } return; -} +} ## end sub increment_brace_error sub report_definite_bug { $tokenizer_self->[_hit_bug_] = 1; @@ -597,7 +597,7 @@ sub report_definite_bug { $logger_object->report_definite_bug(); } return; -} +} ## end sub report_definite_bug sub brace_warning { my $msg = shift; @@ -606,7 +606,7 @@ sub brace_warning { $logger_object->brace_warning($msg); } return; -} +} ## end sub brace_warning sub get_saw_brace_error { my $logger_object = $tokenizer_self->[_logger_object_]; @@ -616,7 +616,7 @@ sub get_saw_brace_error { else { return 0; } -} +} ## end sub get_saw_brace_error sub get_unexpected_error_count { my ($self) = @_; @@ -630,7 +630,7 @@ sub write_diagnostics { $tokenizer_self->[_diagnostics_object_]->write_diagnostics($msg); } return; -} +} ## end sub write_diagnostics sub get_maximum_level { return $tokenizer_self->[_maximum_level_]; @@ -835,7 +835,7 @@ sub log_numbered_msg { my $input_line_number = $self->[_last_line_number_]; write_logfile_entry("Line $input_line_number: $msg"); return; -} +} ## end sub log_numbered_msg # returns the next tokenized line sub get_line { @@ -2013,7 +2013,7 @@ EOM scan_bare_identifier_do( $input_line, $i, $tok, $type, $prototype, $rtoken_map, $max_token_index ); return; - } + } ## end sub scan_bare_identifier sub scan_identifier { ( @@ -2062,7 +2062,7 @@ EOM '%' => LIST_CONTEXT, '&' => UNKNOWN_CONTEXT, ); - } + } ## end BEGIN sub scan_simple_identifier { @@ -2267,7 +2267,7 @@ EOM # We will stop here and assume that this is valid syntax for # use feature 'class'. return 1; - } + } ## end sub method_ok_here sub class_ok_here { @@ -2344,14 +2344,14 @@ EOM # We will stop here and assume that this is valid syntax for # use feature 'class'. return 1; - } + } ## end sub class_ok_here sub scan_id { ( $i, $tok, $type, $id_scan_state ) = scan_id_do( $input_line, $i, $tok, $rtokens, $rtoken_map, $id_scan_state, $max_token_index ); return; - } + } ## end sub scan_id sub scan_number { my $number; @@ -2359,7 +2359,7 @@ EOM scan_number_do( $input_line, $i, $rtoken_map, $type, $max_token_index ); return $number; - } + } ## end sub scan_number use constant VERIFY_FASTNUM => 0; @@ -2493,7 +2493,7 @@ EOM error_if_expecting_TERM() if ( $expecting == TERM ); return; - } + } ## end sub do_GREATER_THAN_SIGN sub do_VERTICAL_LINE { @@ -2501,7 +2501,7 @@ EOM error_if_expecting_TERM() if ( $expecting == TERM ); return; - } + } ## end sub do_VERTICAL_LINE sub do_DOLLAR_SIGN { @@ -3240,7 +3240,7 @@ EOM if ( $expecting == OPERATOR ); scan_simple_identifier(); return; - } + } ## end sub do_AT_SIGN sub do_PERCENT_SIGN { @@ -3386,7 +3386,7 @@ EOM # '::' = probably a sub call scan_bare_identifier(); return; - } + } ## end sub do_DOUBLE_COLON sub do_LEFT_SHIFT { @@ -3509,7 +3509,7 @@ EOM # '->' return; - } ## end sub do_POINTER + } sub do_PLUS_PLUS { @@ -3574,7 +3574,7 @@ EOM error_if_expecting_TERM() if ( $expecting == TERM && $last_nonblank_token ne ',' ); #c015 return; - } + } ## end sub do_LOGICAL_AND sub do_LOGICAL_OR { @@ -3582,7 +3582,7 @@ EOM error_if_expecting_TERM() if ( $expecting == TERM && $last_nonblank_token ne ',' ); #c015 return; - } + } ## end sub do_LOGICAL_OR sub do_SLASH_SLASH { @@ -3590,7 +3590,7 @@ EOM error_if_expecting_TERM() if ( $expecting == TERM ); return; - } + } ## end sub do_SLASH_SLASH sub do_DIGITS { @@ -5794,7 +5794,7 @@ BEGIN { @q = qw( n v ); @{is_n_v}{@q} = (1) x scalar(@q); -} +} ## end BEGIN use constant DEBUG_OPERATOR_EXPECTED => 0; @@ -6476,7 +6476,7 @@ BEGIN { @q = qw(R ]); @{is_R_closing_sb}{@q} = (1) x scalar(@q); -} +} ## end BEGIN sub is_non_structural_brace { @@ -6930,7 +6930,7 @@ BEGIN { # parenless calls of 'ok' are common @q = qw( ok ); @{is_known_function}{@q} = (1) x scalar(@q); -} +} ## end BEGIN sub guess_if_pattern_or_division { @@ -7606,7 +7606,7 @@ BEGIN { my @q = qw{ ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ }; @{is_special_variable_char}{@q} = (1) x scalar(@q); -} +} ## end BEGIN { ## begin closure for sub scan_complex_identifier @@ -8468,7 +8468,7 @@ EOM # lexical subs with these names can cause parsing errors in this version my @q = qw( m q qq qr qw qx s tr y ); @{warn_if_lexical}{@q} = (1) x scalar(@q); - } + } ## end BEGIN # saved package and subnames in case prototype is on separate line my ( $package_saved, $subname_saved ); @@ -8946,7 +8946,7 @@ sub is_possible_numerator { my @q = qw( & && | || ? : + - * and or while if unless); push @q, ')', '}', ']', '>', ',', ';'; @{pattern_test}{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub pattern_expected { @@ -9725,7 +9725,7 @@ sub indicate_error { write_error_indicator_pair( $line_number, $input_line, $pos, $carrat ); resume_logfile(); return; -} +} ## end sub indicate_error sub write_error_indicator_pair { my ( $line_number, $input_line, $pos, $carrat ) = @_; @@ -9910,7 +9910,7 @@ sub show_tokens { '[' => ']', '<' => '>', ); - } + } ## end BEGIN sub matching_end_token { @@ -9920,7 +9920,7 @@ sub show_tokens { return $matching_end_token{$beginning_token}; } return ($beginning_token); - } + } ## end sub matching_end_token } sub dump_token_types { @@ -10657,5 +10657,5 @@ BEGIN { # __DATA__ __END__ @is_keyword{@Keywords} = (1) x scalar(@Keywords); -} +} ## end BEGIN 1; diff --git a/lib/Perl/Tidy/VerticalAligner.pm b/lib/Perl/Tidy/VerticalAligner.pm index 11a1acfe..f6167ac6 100644 --- a/lib/Perl/Tidy/VerticalAligner.pm +++ b/lib/Perl/Tidy/VerticalAligner.pm @@ -78,7 +78,7 @@ This error is probably due to a recent programming change ====================================================================== EOM exit 1; -} +} ## end sub AUTOLOAD sub DESTROY { @@ -120,7 +120,7 @@ EOM # We shouldn't get here, but this return is to keep Perl-Critic from # complaining. return; -} +} ## end sub Fault my %valid_LINE_keys; @@ -154,7 +154,7 @@ BEGIN { ); @valid_LINE_keys{@q} = (1) x scalar(@q); -} +} ## end BEGIN BEGIN { @@ -211,7 +211,7 @@ BEGIN { }; DEBUG_TABS && $debug_warning->('TABS'); -} +} ## end BEGIN # GLOBAL variables my ( @@ -273,7 +273,7 @@ sub check_options { } return; -} +} ## end sub check_options sub check_keys { my ( $rtest, $rvalid, $msg, $exact_match ) = @_; @@ -378,7 +378,7 @@ sub new { bless $self, $class; return $self; -} +} ## end sub new ################################# # CODE SECTION 2: Basic Utilities @@ -401,7 +401,7 @@ sub flush { $self->dump_valign_buffer(); return; -} +} ## end sub flush sub initialize_for_new_group { my ($self) = @_; @@ -416,7 +416,7 @@ sub initialize_for_new_group { # Note that the value for _group_level_ is # handled separately in sub valign_input return; -} +} ## end sub initialize_for_new_group sub group_line_count { return +@{ $_[0]->[_rgroup_lines_] }; @@ -431,7 +431,7 @@ sub write_diagnostics { $diagnostics_object->write_diagnostics($msg); } return; -} +} ## end sub write_diagnostics { ## begin closure for logger routines my $logger_object; @@ -452,7 +452,7 @@ sub write_diagnostics { $input_stream_name = $logger_object->get_input_stream_name(); } return $input_stream_name; - } + } ## end sub get_input_stream_name sub warning { my ($msg) = @_; @@ -460,7 +460,7 @@ sub write_diagnostics { $logger_object->warning($msg); } return; - } + } ## end sub warning sub write_logfile_entry { my ($msg) = @_; @@ -468,7 +468,7 @@ sub write_diagnostics { $logger_object->write_logfile_entry($msg); } return; - } + } ## end sub write_logfile_entry } sub get_cached_line_count { @@ -483,7 +483,7 @@ sub get_recoverable_spaces { # to get them to line up with their opening parens my $indentation = shift; return ref($indentation) ? $indentation->get_recoverable_spaces() : 0; -} +} ## end sub get_recoverable_spaces ###################################################### # CODE SECTION 3: Code to accept input and form groups @@ -967,7 +967,7 @@ sub valign_input { }; return; -} +} ## end sub valign_input sub join_hanging_comment { @@ -1014,7 +1014,7 @@ sub join_hanging_comment { $rpatterns->[ $j - 1 ] = EMPTY_STRING; } return 1; -} +} ## end sub join_hanging_comment { ## closure for sub decide_if_list @@ -1025,7 +1025,7 @@ sub join_hanging_comment { my @q = qw( => ); push @q, ','; @is_comma_token{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub decide_if_list { @@ -1054,7 +1054,7 @@ sub join_hanging_comment { $line->{'list_type'} = $list_type; } return; - } + } ## end sub decide_if_list } sub fix_terminal_ternary { @@ -1233,7 +1233,7 @@ sub fix_terminal_ternary { # force a flush after this line return $jquestion; -} +} ## end sub fix_terminal_ternary sub fix_terminal_else { @@ -1305,7 +1305,7 @@ sub fix_terminal_else { # force a flush after this line if it does not follow a case if ( $rfields_old->[0] =~ /^case\s*$/ ) { return } else { return $jbrace } -} +} ## end sub fix_terminal_else my %is_closing_block_type; @@ -1417,7 +1417,7 @@ sub check_match { "returning $return_value because $GoToMsg, max match index =i $imax_align, jmax=$jmax\n"; return ( $return_value, $imax_align ); -} +} ## end sub check_match sub check_fit { @@ -1488,7 +1488,7 @@ EOM #------------------------------------- return 1; -} +} ## end sub check_fit sub install_new_alignments { @@ -1509,14 +1509,14 @@ sub install_new_alignments { } $new_line->{'ralignments'} = \@alignments; return; -} +} ## end sub install_new_alignments sub copy_old_alignments { my ( $new_line, $old_line ) = @_; my @new_alignments = @{ $old_line->{'ralignments'} }; $new_line->{'ralignments'} = \@new_alignments; return; -} +} ## end sub copy_old_alignments sub dump_array { @@ -1524,7 +1524,7 @@ sub dump_array { local $LIST_SEPARATOR = ')('; print STDOUT "(@_)\n"; return; -} +} ## end sub dump_array sub level_change { @@ -1541,7 +1541,7 @@ sub level_change { if ( $level < 0 ) { $level = 0 } } return $level; -} +} ## end sub level_change ############################################### # CODE SECTION 4: Code to process comment lines @@ -1612,7 +1612,7 @@ sub _flush_comment_lines { $self->initialize_for_new_group(); return; -} +} ## end sub _flush_comment_lines ###################################################### # CODE SECTION 5: Code to process groups of code lines @@ -1729,7 +1729,7 @@ sub _flush_group_lines { $self->initialize_for_new_group(); return; -} +} ## end sub _flush_group_lines { ## closure for sub sweep_top_down @@ -1762,7 +1762,7 @@ sub _flush_group_lines { push @{$rgroups}, [ $jbeg, $jend, undef ]; $group_line_count++; return; - } + } ## end sub add_to_rgroup sub get_rgroup_jrange { @@ -1770,7 +1770,7 @@ sub _flush_group_lines { return unless ( $group_line_count > 0 ); my ( $jbeg, $jend ) = @{ $rgroups->[-1] }; return ( $jbeg, $jend ); - } + } ## end sub get_rgroup_jrange sub end_rgroup { @@ -1808,7 +1808,7 @@ sub _flush_group_lines { initialize_for_new_rgroup(); return; - } + } ## end sub end_rgroup sub block_penultimate_match { @@ -1817,7 +1817,7 @@ sub _flush_group_lines { return unless @{$rgroups} > 1; $rgroups->[-2]->[2] = -1; return; - } + } ## end sub block_penultimate_match sub sweep_top_down { my ( $self, $rlines, $group_level ) = @_; @@ -1991,7 +1991,7 @@ EOM end_rgroup(-1); return ($rgroups); - } + } ## end sub sweep_top_down } sub two_line_pad { @@ -2049,7 +2049,7 @@ sub two_line_pad { if ( !$patterns_match && $lenmax > 2 * $lenmin ) { $pad_max = 0 } return $pad_max; -} +} ## end sub two_line_pad sub sweep_left_to_right { @@ -2222,7 +2222,7 @@ sub sweep_left_to_right { do_left_to_right_sweep( $rlines, $rgroups, \@todo, \%max_move, $short_pad, $group_level ); return; -} +} ## end sub sweep_left_to_right { ## closure for sub do_left_to_right_sweep @@ -2262,7 +2262,7 @@ sub sweep_left_to_right { # if ($is_good_alignment_token{$raw_tok}) => best # if defined ($is_good_alignment_token{$raw_tok}) => good or best - } + } ## end BEGIN sub move_to_common_column { @@ -2295,7 +2295,7 @@ sub sweep_left_to_right { } } return; - } + } ## end sub move_to_common_column sub do_left_to_right_sweep { my ( $rlines, $rgroups, $rtodo, $rmax_move, $short_pad, $group_level ) @@ -2482,7 +2482,7 @@ sub sweep_left_to_right { } ## end loop over tasks return; - } + } ## end sub do_left_to_right_sweep } sub delete_selected_tokens { @@ -2597,7 +2597,7 @@ new patterns: <@{$rpatterns_new}> new fields: <@{$rfields_new}> EOM return; -} +} ## end sub delete_selected_tokens { ## closure for sub decode_alignment_token @@ -2613,7 +2613,7 @@ EOM # number of files is processed at once. %decoded_token = (); return; - } + } ## end sub initialize_decode sub decode_alignment_token { @@ -2652,7 +2652,7 @@ EOM my @vals = ( $raw_tok, $lev, $tag, $tok_count ); $decoded_token{$tok} = \@vals; return @vals; - } + } ## end sub decode_alignment_token } { ## closure for sub delete_unmatched_tokens @@ -2677,7 +2677,7 @@ EOM ); @keep_after_deleted_assignment{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub delete_unmatched_tokens { my ( $rlines, $group_level ) = @_; @@ -2752,7 +2752,7 @@ EOM match_line_pairs( $rlines, $rnew_lines, \@subgroups, $group_level ); return ( $max_lev_diff, $saw_side_comment ); - } + } ## end sub delete_unmatched_tokens sub make_alignment_info { @@ -3277,7 +3277,7 @@ sub match_line_pairs { } } return; -} +} ## end sub match_line_pairs sub compare_patterns { @@ -3405,7 +3405,7 @@ sub fat_comma_to_comma { # For example, we will change '=>2+{-3.2' into ',2+{-3' if ( $str =~ /^=>([^\.]*)/ ) { $str = ',' . $1 } return $str; -} +} ## end sub fat_comma_to_comma sub get_line_token_info { @@ -3557,7 +3557,7 @@ sub get_line_token_info { }; } ## end loop over lines return ( $rline_values, $all_monotonic ); -} +} ## end sub get_line_token_info sub prune_alignment_tree { my ($rlines) = @_; @@ -3952,7 +3952,7 @@ sub Dump_tree_groups { print "(@fix)\n"; } return; -} +} ## end sub Dump_tree_groups { ## closure for sub is_marginal_match @@ -3984,7 +3984,7 @@ sub Dump_tree_groups { @q = qw( { ? => = ); push @q, (','); @is_good_alignment{@q} = (1) x scalar(@q); - } + } ## end BEGIN sub is_marginal_match { @@ -4306,7 +4306,7 @@ sub Dump_tree_groups { } return ( $is_marginal, $imax_align ); - } + } ## end sub is_marginal_match } ## end closure for sub is_marginal_match sub get_extra_leading_spaces { @@ -4378,7 +4378,7 @@ sub get_extra_leading_spaces { # ');' will use the same adjustment. $object->permanently_decrease_available_spaces( -$extra_leading_spaces ); return $extra_leading_spaces; -} +} ## end sub get_extra_leading_spaces sub forget_side_comment { my ($self) = @_; @@ -4463,7 +4463,7 @@ sub is_good_side_comment_column { # Otherwise, keep it alive return $KEEP; -} +} ## end sub is_good_side_comment_column sub align_side_comments { @@ -4650,7 +4650,7 @@ sub align_side_comments { $self->[_last_side_comment_level_] = $group_level; } return; -} +} ## end sub align_side_comments ############################### # CODE SECTION 6: Output Step A @@ -4778,7 +4778,7 @@ sub valign_output_step_A { } ); return; -} +} ## end sub valign_output_step_A sub combine_fields { @@ -4818,7 +4818,7 @@ sub combine_fields { $line_0->{'ralignments'} = \@new_alignments; $line_1->{'ralignments'} = \@new_alignments; return; -} +} ## end sub combine_fields sub get_output_line_number { @@ -4827,7 +4827,7 @@ sub get_output_line_number { # the number of items written. return $_[0]->group_line_count() + $_[0]->[_file_writer_object_]->get_output_line_number(); -} +} ## end sub get_output_line_number ############################### # CODE SECTION 7: Output Step B @@ -4896,7 +4896,7 @@ sub get_output_line_number { $seqno_string = EMPTY_STRING; $last_nonblank_seqno_string = EMPTY_STRING; return; - } + } ## end sub initialize_step_B_cache sub _flush_step_B_cache { my ($self) = @_; @@ -4921,7 +4921,7 @@ sub get_output_line_number { $cached_line_maximum_length = undef; } return; - } + } ## end sub _flush_step_B_cache sub handle_cached_line { @@ -5347,7 +5347,7 @@ sub get_output_line_number { $self->[_last_level_written_] = $level; $self->[_last_side_comment_length_] = $side_comment_length; return; - } + } ## end sub valign_output_step_B } ############################### @@ -5378,7 +5378,7 @@ sub get_output_line_number { } $valign_buffer_filling = EMPTY_STRING; return; - } + } ## end sub dump_valign_buffer sub reduce_valign_buffer_indentation { @@ -5406,7 +5406,7 @@ sub get_output_line_number { } } return; - } + } ## end sub reduce_valign_buffer_indentation sub valign_output_step_C { @@ -5481,7 +5481,7 @@ sub get_output_line_number { } } return; - } + } ## end sub valign_output_step_C } ############################### @@ -5586,7 +5586,7 @@ sub valign_output_step_D { $file_writer_object->write_code_line( $line . "\n", $Kend ); return; -} +} ## end sub valign_output_step_D { ## closure for sub get_leading_string @@ -5659,7 +5659,7 @@ sub valign_output_step_D { } $leading_string_cache[$leading_whitespace_count] = $leading_string; return $leading_string; - } + } ## end sub get_leading_string } ## end get_leading_string ########################## @@ -5688,5 +5688,5 @@ sub report_anything_unusual { write_logfile_entry("\n"); } return; -} +} ## end sub report_anything_unusual 1; diff --git a/lib/Perl/Tidy/VerticalAligner/Line.pm b/lib/Perl/Tidy/VerticalAligner/Line.pm index 31057434..fbe583aa 100644 --- a/lib/Perl/Tidy/VerticalAligner/Line.pm +++ b/lib/Perl/Tidy/VerticalAligner/Line.pm @@ -31,7 +31,7 @@ This error is probably due to a recent programming change ====================================================================== EOM exit 1; -} +} ## end sub AUTOLOAD { @@ -47,7 +47,7 @@ EOM my $alignment = $self->{ralignments}->[$j]; return unless defined($alignment); return $alignment->get_column(); - } + } ## end sub get_column sub current_field_width { my ( $self, $j ) = @_; @@ -62,7 +62,7 @@ EOM $col_jm = $alignment_jm->get_column() if defined($alignment_jm); } return $col_j - $col_jm; - } + } ## end sub current_field_width sub increase_field_width { @@ -75,7 +75,7 @@ EOM } } return; - } + } ## end sub increase_field_width sub get_available_space_on_right { my $jmax = $_[0]->{jmax};