commit perl-Perl-Tidy for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Perl-Tidy for openSUSE:Factory checked in at 2023-09-29 21:12:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Perl-Tidy (Old) and /work/SRC/openSUSE:Factory/.perl-Perl-Tidy.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "perl-Perl-Tidy" Fri Sep 29 21:12:37 2023 rev:44 rq:1114045 version:20230912.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Perl-Tidy/perl-Perl-Tidy.changes 2023-09-13 20:43:56.716760683 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Perl-Tidy.new.28202/perl-Perl-Tidy.changes 2023-09-29 21:12:49.416124515 +0200 @@ -1,0 +2,11 @@ +Wed Sep 13 03:08:55 UTC 2023 - Tina Müller <timueller+perl@suse.de> + +- updated to 20230912 + see /usr/share/doc/packages/perl-Perl-Tidy/CHANGES.md + + ## 2023 09 12 + + - Fix for git #124: remove a syntax error check which could cause + an incorrect error message when List::Gather::gather was used. + +------------------------------------------------------------------- Old: ---- Perl-Tidy-20230909.tar.gz New: ---- Perl-Tidy-20230912.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Perl-Tidy.spec ++++++ --- /var/tmp/diff_new_pack.Zd3A7w/_old 2023-09-29 21:12:50.836175750 +0200 +++ /var/tmp/diff_new_pack.Zd3A7w/_new 2023-09-29 21:12:50.836175750 +0200 @@ -18,9 +18,9 @@ %define cpan_name Perl-Tidy Name: perl-Perl-Tidy -Version: 20230909.0.0 +Version: 20230912.0.0 Release: 0 -%define cpan_version 20230909 +%define cpan_version 20230912 #Upstream: GPL-1.0-or-later License: GPL-2.0-or-later Summary: Indent and reformat perl scripts @@ -30,20 +30,20 @@ BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros -Provides: perl(Perl::Tidy) = 20230909.0.0 -Provides: perl(Perl::Tidy::Debugger) = 20230909.0.0 -Provides: perl(Perl::Tidy::Diagnostics) = 20230909.0.0 -Provides: perl(Perl::Tidy::FileWriter) = 20230909.0.0 -Provides: perl(Perl::Tidy::Formatter) = 20230909.0.0 -Provides: perl(Perl::Tidy::HtmlWriter) = 20230909.0.0 -Provides: perl(Perl::Tidy::IOScalar) = 20230909.0.0 -Provides: perl(Perl::Tidy::IOScalarArray) = 20230909.0.0 -Provides: perl(Perl::Tidy::IndentationItem) = 20230909.0.0 -Provides: perl(Perl::Tidy::Logger) = 20230909.0.0 -Provides: perl(Perl::Tidy::Tokenizer) = 20230909.0.0 -Provides: perl(Perl::Tidy::VerticalAligner) = 20230909.0.0 -Provides: perl(Perl::Tidy::VerticalAligner::Alignment) = 20230909.0.0 -Provides: perl(Perl::Tidy::VerticalAligner::Line) = 20230909.0.0 +Provides: perl(Perl::Tidy) = 20230912.0.0 +Provides: perl(Perl::Tidy::Debugger) = 20230912.0.0 +Provides: perl(Perl::Tidy::Diagnostics) = 20230912.0.0 +Provides: perl(Perl::Tidy::FileWriter) = 20230912.0.0 +Provides: perl(Perl::Tidy::Formatter) = 20230912.0.0 +Provides: perl(Perl::Tidy::HtmlWriter) = 20230912.0.0 +Provides: perl(Perl::Tidy::IOScalar) = 20230912.0.0 +Provides: perl(Perl::Tidy::IOScalarArray) = 20230912.0.0 +Provides: perl(Perl::Tidy::IndentationItem) = 20230912.0.0 +Provides: perl(Perl::Tidy::Logger) = 20230912.0.0 +Provides: perl(Perl::Tidy::Tokenizer) = 20230912.0.0 +Provides: perl(Perl::Tidy::VerticalAligner) = 20230912.0.0 +Provides: perl(Perl::Tidy::VerticalAligner::Alignment) = 20230912.0.0 +Provides: perl(Perl::Tidy::VerticalAligner::Line) = 20230912.0.0 %define __perllib_provides /bin/true %{perl_requires} ++++++ Perl-Tidy-20230909.tar.gz -> Perl-Tidy-20230912.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/CHANGES.md new/Perl-Tidy-20230912/CHANGES.md --- old/Perl-Tidy-20230909/CHANGES.md 2023-09-07 16:31:09.000000000 +0200 +++ new/Perl-Tidy-20230912/CHANGES.md 2023-09-12 21:44:13.000000000 +0200 @@ -1,5 +1,10 @@ # Perltidy Change Log +## 2023 09 12 + + - Fix for git #124: remove a syntax error check which could cause + an incorrect error message when List::Gather::gather was used. + ## 2023 09 09 - Added new parameters -wme, or --warn-missing-else, and -ame, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/META.json new/Perl-Tidy-20230912/META.json --- old/Perl-Tidy-20230909/META.json 2023-09-07 16:37:18.000000000 +0200 +++ new/Perl-Tidy-20230912/META.json 2023-09-12 21:47:13.000000000 +0200 @@ -47,6 +47,6 @@ "web" : "https://github.com/perltidy/perltidy" } }, - "version" : "20230909", + "version" : "20230912", "x_serialization_backend" : "JSON::PP version 4.04" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/META.yml new/Perl-Tidy-20230912/META.yml --- old/Perl-Tidy-20230909/META.yml 2023-09-07 16:37:18.000000000 +0200 +++ new/Perl-Tidy-20230912/META.yml 2023-09-12 21:47:13.000000000 +0200 @@ -22,5 +22,5 @@ resources: bugtracker: https://github.com/perltidy/perltidy/issues repository: https://github.com/perltidy/perltidy.git -version: '20230909' +version: '20230912' x_serialization_backend: 'CPAN::Meta::YAML version 0.012' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/bin/perltidy new/Perl-Tidy-20230912/bin/perltidy --- old/Perl-Tidy-20230909/bin/perltidy 2023-09-07 16:23:23.000000000 +0200 +++ new/Perl-Tidy-20230912/bin/perltidy 2023-09-12 21:44:13.000000000 +0200 @@ -5878,7 +5878,7 @@ =head1 VERSION -This man page documents perltidy version 20230909 +This man page documents perltidy version 20230912 =head1 BUG REPORTS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/docs/ChangeLog.html new/Perl-Tidy-20230912/docs/ChangeLog.html --- old/Perl-Tidy-20230909/docs/ChangeLog.html 2023-09-07 16:37:11.000000000 +0200 +++ new/Perl-Tidy-20230912/docs/ChangeLog.html 2023-09-12 21:46:14.000000000 +0200 @@ -1,5 +1,11 @@ <h1>Perltidy Change Log</h1> +<h2>2023 09 12</h2> + +<pre><code>- Fix for git #124: remove a syntax error check which could cause + an incorrect error message when List::Gather::gather was used. +</code></pre> + <h2>2023 09 09</h2> <pre><code>- Added new parameters -wme, or --warn-missing-else, and -ame, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/docs/Tidy.html new/Perl-Tidy-20230912/docs/Tidy.html --- old/Perl-Tidy-20230909/docs/Tidy.html 2023-09-07 16:37:11.000000000 +0200 +++ new/Perl-Tidy-20230912/docs/Tidy.html 2023-09-12 21:46:14.000000000 +0200 @@ -399,7 +399,7 @@ <h1 id="VERSION">VERSION</h1> -<p>This man page documents Perl::Tidy version 20230909</p> +<p>This man page documents Perl::Tidy version 20230912</p> <h1 id="LICENSE">LICENSE</h1> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/docs/perltidy.html new/Perl-Tidy-20230912/docs/perltidy.html --- old/Perl-Tidy-20230909/docs/perltidy.html 2023-09-07 16:37:11.000000000 +0200 +++ new/Perl-Tidy-20230912/docs/perltidy.html 2023-09-12 21:46:14.000000000 +0200 @@ -4597,7 +4597,7 @@ <h1 id="VERSION">VERSION</h1> -<p>This man page documents perltidy version 20230909</p> +<p>This man page documents perltidy version 20230912</p> <h1 id="BUG-REPORTS">BUG REPORTS</h1> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/Debugger.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/Debugger.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/Debugger.pm 2023-09-06 20:49:41.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/Debugger.pm 2023-09-12 21:44:14.000000000 +0200 @@ -8,7 +8,7 @@ use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230909'; +our $VERSION = '20230912'; use constant EMPTY_STRING => q{}; use constant SPACE => q{ }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/Diagnostics.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/Diagnostics.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/Diagnostics.pm 2023-09-06 20:49:42.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/Diagnostics.pm 2023-09-12 21:44:15.000000000 +0200 @@ -18,7 +18,7 @@ use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230909'; +our $VERSION = '20230912'; use constant EMPTY_STRING => q{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/FileWriter.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/FileWriter.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/FileWriter.pm 2023-09-06 20:49:43.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/FileWriter.pm 2023-09-12 21:44:16.000000000 +0200 @@ -7,7 +7,7 @@ package Perl::Tidy::FileWriter; use strict; use warnings; -our $VERSION = '20230909'; +our $VERSION = '20230912'; use constant DEVEL_MODE => 0; use constant EMPTY_STRING => q{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/Formatter.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/Formatter.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/Formatter.pm 2023-09-06 20:49:43.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/Formatter.pm 2023-09-12 21:44:16.000000000 +0200 @@ -53,7 +53,7 @@ use Carp; use English qw( -no_match_vars ); use List::Util qw( min max first ); # min, max first are in Perl 5.8 -our $VERSION = '20230909'; +our $VERSION = '20230912'; # The Tokenizer will be loaded with the Formatter ##use Perl::Tidy::Tokenizer; # for is_keyword() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/HtmlWriter.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/HtmlWriter.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/HtmlWriter.pm 2023-09-06 20:49:44.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/HtmlWriter.pm 2023-09-12 21:44:17.000000000 +0200 @@ -7,7 +7,7 @@ package Perl::Tidy::HtmlWriter; use strict; use warnings; -our $VERSION = '20230909'; +our $VERSION = '20230912'; use English qw( -no_match_vars ); use File::Basename; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/IOScalar.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/IOScalar.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/IOScalar.pm 2023-09-06 20:49:45.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/IOScalar.pm 2023-09-12 21:44:18.000000000 +0200 @@ -10,7 +10,7 @@ use strict; use warnings; use Carp; -our $VERSION = '20230909'; +our $VERSION = '20230912'; use constant DEVEL_MODE => 0; use constant EMPTY_STRING => q{}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/IOScalarArray.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/IOScalarArray.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/IOScalarArray.pm 2023-09-06 20:49:45.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/IOScalarArray.pm 2023-09-12 21:44:18.000000000 +0200 @@ -14,7 +14,7 @@ use strict; use warnings; use Carp; -our $VERSION = '20230909'; +our $VERSION = '20230912'; use constant DEVEL_MODE => 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/IndentationItem.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/IndentationItem.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/IndentationItem.pm 2023-09-06 20:49:46.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/IndentationItem.pm 2023-09-12 21:44:19.000000000 +0200 @@ -8,7 +8,7 @@ package Perl::Tidy::IndentationItem; use strict; use warnings; -our $VERSION = '20230909'; +our $VERSION = '20230912'; BEGIN { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/Logger.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/Logger.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/Logger.pm 2023-09-06 20:49:46.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/Logger.pm 2023-09-12 21:44:19.000000000 +0200 @@ -8,7 +8,7 @@ package Perl::Tidy::Logger; use strict; use warnings; -our $VERSION = '20230909'; +our $VERSION = '20230912'; use English qw( -no_match_vars ); use constant DEVEL_MODE => 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/Tokenizer.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/Tokenizer.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/Tokenizer.pm 2023-09-07 01:46:44.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/Tokenizer.pm 2023-09-12 21:44:20.000000000 +0200 @@ -22,7 +22,7 @@ use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230909'; +our $VERSION = '20230912'; use Carp; @@ -124,8 +124,22 @@ # INITIALIZER: sub check_options $code_skipping_pattern_begin, $code_skipping_pattern_end, + $rOpts_code_skipping, $rOpts_code_skipping_begin, + $rOpts_starting_indentation_level, + $rOpts_indent_columns, + $rOpts_look_for_hash_bang, + $rOpts_look_for_autoloader, + $rOpts_look_for_selfloader, + $rOpts_trim_qw, + $rOpts_extended_syntax, + $rOpts_continuation_indentation, + $rOpts_outdent_labels, + $rOpts_maximum_level_errors, + $rOpts_maximum_unexpected_errors, + + $tabsize, %is_END_DATA_format_sub, %is_grep_alias, %is_sub, @@ -170,12 +184,6 @@ _line_start_quote_ => $i++, _starting_level_ => $i++, _know_starting_level_ => $i++, - _tabsize_ => $i++, - _indent_columns_ => $i++, - _look_for_hash_bang_ => $i++, - _trim_qw_ => $i++, - _continuation_indentation_ => $i++, - _outdent_labels_ => $i++, _last_line_number_ => $i++, _saw_perl_dash_P_ => $i++, _saw_perl_dash_w_ => $i++, @@ -200,12 +208,8 @@ _nearly_matched_here_target_at_ => $i++, _line_of_text_ => $i++, _rlower_case_labels_at_ => $i++, - _extended_syntax_ => $i++, _maximum_level_ => $i++, _true_brace_error_count_ => $i++, - _rOpts_maximum_level_errors_ => $i++, - _rOpts_maximum_unexpected_errors_ => $i++, - _rOpts_logfile_ => $i++, _rOpts_ => $i++, _rinput_lines_ => $i++, _input_line_index_next_ => $i++, @@ -410,8 +414,36 @@ @{is_grep_alias}{@q} = (1) x scalar(@q); } - $rOpts_code_skipping = $rOpts->{'code-skipping'}; - $rOpts_code_skipping_begin = $rOpts->{'code-skipping-begin'}; + $rOpts_starting_indentation_level = $rOpts->{'starting-indentation-level'}; + $rOpts_indent_columns = $rOpts->{'indent-columns'}; + $rOpts_look_for_hash_bang = $rOpts->{'look-for-hash-bang'}; + $rOpts_look_for_autoloader = $rOpts->{'look-for-autoloader'}; + $rOpts_look_for_selfloader = $rOpts->{'look-for-selfloader'}; + $rOpts_trim_qw = $rOpts->{'trim-qw'}; + $rOpts_extended_syntax = $rOpts->{'extended-syntax'}; + $rOpts_continuation_indentation = $rOpts->{'continuation-indentation'}; + $rOpts_outdent_labels = $rOpts->{'outdent-labels'}; + $rOpts_maximum_level_errors = $rOpts->{'maximum-level-errors'}; + $rOpts_maximum_unexpected_errors = $rOpts->{'maximum-unexpected-errors'}; + $rOpts_code_skipping = $rOpts->{'code-skipping'}; + $rOpts_code_skipping_begin = $rOpts->{'code-skipping-begin'}; + + # In the Tokenizer, --indent-columns is just used for guessing old + # indentation, and must be positive. If -i=0 is used for this run (which + # is possible) we'll just guess that the old run used 4 spaces per level. + if ( !$rOpts_indent_columns ) { $rOpts_indent_columns = 4 } + + # Define $tabsize, the number of spaces per tab for use in + # guessing the indentation of source lines with leading tabs. + # Assume same as for this run if tabs are used, otherwise assume + # a default value, typically 8 + $tabsize = + $rOpts->{'entab-leading-whitespace'} + ? $rOpts->{'entab-leading-whitespace'} + : $rOpts->{'tabs'} ? $rOpts->{'indent-columns'} + : $rOpts->{'default-tabsize'}; + if ( !$tabsize ) { $tabsize = 8 } + $code_skipping_pattern_begin = make_code_skipping_pattern( $rOpts, 'code-skipping-begin', '#<<V' ); $code_skipping_pattern_end = @@ -424,22 +456,13 @@ my ( $class, @args ) = @_; - # Note: 'tabs' and 'indent_columns' are temporary and should be - # removed asap my %defaults = ( source_object => undef, debugger_object => undef, diagnostics_object => undef, logger_object => undef, starting_level => undef, - indent_columns => 4, - tabsize => 8, - look_for_hash_bang => 0, - trim_qw => 1, - look_for_autoloader => 1, - look_for_selfloader => 1, starting_line_number => 1, - extended_syntax => 0, rOpts => {}, ); my %args = ( %defaults, @args ); @@ -506,12 +529,6 @@ $self->[_line_start_quote_] = -1; $self->[_starting_level_] = $args{starting_level}; $self->[_know_starting_level_] = defined( $args{starting_level} ); - $self->[_tabsize_] = $args{tabsize}; - $self->[_indent_columns_] = $args{indent_columns}; - $self->[_look_for_hash_bang_] = $args{look_for_hash_bang}; - $self->[_trim_qw_] = $args{trim_qw}; - $self->[_continuation_indentation_] = $args{continuation_indentation}; - $self->[_outdent_labels_] = $args{outdent_labels}; $self->[_last_line_number_] = $args{starting_line_number} - 1; $self->[_saw_perl_dash_P_] = 0; $self->[_saw_perl_dash_w_] = 0; @@ -519,8 +536,8 @@ $self->[_saw_v_string_] = 0; $self->[_saw_brace_error_] = 0; $self->[_hit_bug_] = 0; - $self->[_look_for_autoloader_] = $args{look_for_autoloader}; - $self->[_look_for_selfloader_] = $args{look_for_selfloader}; + $self->[_look_for_autoloader_] = $rOpts_look_for_autoloader; + $self->[_look_for_selfloader_] = $rOpts_look_for_selfloader; $self->[_saw_autoloader_] = 0; $self->[_saw_selfloader_] = 0; $self->[_saw_hash_bang_] = 0; @@ -536,18 +553,9 @@ $self->[_nearly_matched_here_target_at_] = undef; $self->[_line_of_text_] = EMPTY_STRING; $self->[_rlower_case_labels_at_] = undef; - $self->[_extended_syntax_] = $args{extended_syntax}; $self->[_maximum_level_] = 0; $self->[_true_brace_error_count_] = 0; - $self->[_rOpts_maximum_level_errors_] = $rOpts->{'maximum-level-errors'}; - $self->[_rOpts_maximum_unexpected_errors_] = - $rOpts->{'maximum-unexpected-errors'}; - $self->[_rOpts_logfile_] = $rOpts->{'logfile'}; - $self->[_rOpts_] = $rOpts; - - # These vars are used for guessing indentation and must be positive - $self->[_tabsize_] = 8 if ( !$self->[_tabsize_] ); - $self->[_indent_columns_] = 4 if ( !$self->[_indent_columns_] ); + $self->[_rOpts_] = $rOpts; bless $self, $class; @@ -790,8 +798,8 @@ $logger_object->set_last_input_line_number($last_line_number); } - my $maxle = $self->[_rOpts_maximum_level_errors_]; - my $maxue = $self->[_rOpts_maximum_unexpected_errors_]; + my $maxle = $rOpts_maximum_level_errors; + my $maxue = $rOpts_maximum_unexpected_errors; $maxle = 1 unless defined($maxle); $maxue = 0 unless defined($maxue); @@ -822,7 +830,7 @@ $severe_error = 1; } - if ( $self->[_look_for_hash_bang_] + if ( $rOpts_look_for_hash_bang && !$self->[_saw_hash_bang_] ) { $self->warning( @@ -1266,7 +1274,7 @@ $last_nonblank_block_type && $last_nonblank_block_type eq 'BEGIN' ) - && !$self->[_look_for_hash_bang_] + && !$rOpts_look_for_hash_bang # Try to avoid giving a false alarm at a simple comment. # These look like valid hash-bang lines: @@ -1306,7 +1314,7 @@ } # wait for a hash-bang before parsing if the user invoked us with -x - if ( $self->[_look_for_hash_bang_] + if ( $rOpts_look_for_hash_bang && !$self->[_saw_hash_bang_] ) { $line_of_tokens->{_line_type} = 'SYSTEM'; @@ -1495,7 +1503,7 @@ } # if we know there is a hash_bang line, the level must be zero - elsif ( $self->[_look_for_hash_bang_] ) { + elsif ($rOpts_look_for_hash_bang) { $self->[_know_starting_level_] = 1; } @@ -1573,22 +1581,17 @@ # If there are leading tabs, we use the tab scheme for this run, if # any, so that the code will remain stable when editing. - if ($1) { $spaces += length($1) * $self->[_tabsize_] } + if ($1) { $spaces += length($1) * $tabsize } if ($2) { $spaces += length($2) } # correct for outdented labels - if ( $3 && $self->[_outdent_labels_] ) { - $spaces += $self->[_continuation_indentation_]; + if ( $3 && $rOpts_outdent_labels ) { + $spaces += $rOpts_continuation_indentation; } } - # compute indentation using the value of -i for this run. - # If -i=0 is used for this run (which is possible) it doesn't matter - # what we do here but we'll guess that the old run used 4 spaces per level. - my $indent_columns = $self->[_indent_columns_]; - $indent_columns = 4 if ( !$indent_columns ); - $level = int( $spaces / $indent_columns ); + $level = int( $spaces / $rOpts_indent_columns ); return ($level); } ## end sub guess_old_indentation_level @@ -3196,8 +3199,12 @@ if ( defined($rvars) ) { my ( $type_lp, $want_brace ) = @{$rvars}; - # Now verify that this is not a trailing form - if ( !$want_brace ) { + # OLD: Now verify that this is not a trailing form + # FIX for git #124: we have to skip this check because + # the 'gather' keyword of List::Gather can operate on + # a full statement, so it isn't possible to be sure + # this is a trailing form. + if ( 0 && !$want_brace ) { $self->warning( "syntax error at ') {', unexpected '{' after closing ')' of a trailing '$last_nonblank_token'\n" ); @@ -3205,7 +3212,7 @@ } } else { - if ( $self->[_extended_syntax_] ) { + if ($rOpts_extended_syntax) { # we append a trailing () to mark this as an unknown # block type. This allows perltidy to format some @@ -4347,7 +4354,7 @@ # of leading and trailing whitespace. So they are given a # separate type, 'q', unless requested otherwise. $type = - ( $tok eq 'qw' && $self->[_trim_qw_] ) + ( $tok eq 'qw' && $rOpts_trim_qw ) ? 'q' : 'Q'; $quote_type = $type; @@ -4501,7 +4508,7 @@ sub do_BAREWORD { - my ( $self, $is_END_or_DATA ) = @_; + my ($self) = @_; # handle a bareword token: # returns @@ -4553,11 +4560,14 @@ } # Quote a word followed by => operator - # unless the word __END__ or __DATA__ and the only word on - # the line. - elsif ( !$is_END_or_DATA - && $next_nonblank_token eq '=' - && $rtokens->[ $i_next + 1 ] eq '>' ) + elsif ( + ( $next_nonblank_token eq '=' && $rtokens->[ $i_next + 1 ] eq '>' ) + + # unless the word is __END__ or __DATA__ and is the only word on + # the line. + && ( !defined( $is_END_DATA{$tok_kw} ) + || $input_line !~ /^\s*__(?:END|DATA)__\s*$/ ) + ) { $self->do_QUOTED_BAREWORD(); } @@ -4737,7 +4747,7 @@ # It simplifies things to give these type ';', so that when we # start rescanning we will be expecting a token of type TERM. # We will switch to type 'k' before outputting the tokens. - elsif ( $is_END_DATA{$tok_kw} ) { + elsif ( defined( $is_END_DATA{$tok_kw} ) ) { $type = ';'; # make tokenizer look for TERM next # Remember that we are in one of these three sections @@ -5112,11 +5122,6 @@ chomp $input_line; - # Set a flag to indicate if we might be at an __END__ or __DATA__ line - # This will be used below to avoid quoting a bare word followed by - # a fat comma. - my $is_END_or_DATA; - # Reinitialize the multi-line quote flag if ( $in_quote && $quote_type eq 'Q' ) { $line_of_tokens->{_starting_in_quote} = 1; @@ -5145,15 +5150,12 @@ ord( substr( $untrimmed_input_line, 0, 1 ) ) == ORD_TAB && $untrimmed_input_line =~ /^(\t+)/ ) { - my $tabsize = $self->[_tabsize_]; $spaces += length($1) * ( $tabsize - 1 ); } # Calculate a guessed level for nonblank lines to avoid - # calls to sub guess_old_indentation_level() - my $indent_columns = $self->[_indent_columns_]; $line_of_tokens->{_guessed_indentation_level} = - int( $spaces / $indent_columns ); + int( $spaces / $rOpts_indent_columns ); } } else { @@ -5161,7 +5163,6 @@ # line has all blank characters $input_line = EMPTY_STRING; } - } if ( !$in_quote ) { @@ -5207,13 +5208,6 @@ $line_of_tokens->{_nesting_blocks_0} = $nesting_block_string; return; } - - # Look for __END__ or __DATA__ lines - if ( substr( $input_line, 0, 1 ) eq '_' - && $input_line =~ /^__(END|DATA)__\s*$/ ) - { - $is_END_or_DATA = 1; - } } # update the copy of the line for use in error messages @@ -5239,7 +5233,7 @@ $indent_flag = 0; $peeked_ahead = 0; - $self->tokenizer_main_loop($is_END_or_DATA); + $self->tokenizer_main_loop(); #----------------------------------------------- # all done tokenizing this line ... @@ -5252,15 +5246,12 @@ sub tokenizer_main_loop { - my ( $self, $is_END_or_DATA ) = @_; + my ($self) = @_; #--------------------------------- # Break one input line into tokens #--------------------------------- - # Input parameter: - # $is_END_or_DATA is true for a __END__ or __DATA__ line - # start by breaking the line into pre-tokens ( $rtokens, $rtoken_map, $rtoken_type ) = pre_tokenize($input_line); @@ -5558,7 +5549,7 @@ # END NODE 3: a bare word #------------------------ if ( $pre_type eq 'w' ) { - my $is_last = $self->do_BAREWORD($is_END_or_DATA); + my $is_last = $self->do_BAREWORD(); last if ($is_last); next; } @@ -10089,7 +10080,7 @@ if ( $excess > 0 ) { $pos_chr = substr( $pos_chr, 0, length($pos_chr) - $excess ); } - substr( $underline, $pos, length($pos_chr) ) = $pos_chr; + substr( $underline, $pos, length($pos_chr), $pos_chr ); return ($underline); } ## end sub write_on_underline diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/VerticalAligner/Alignment.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/VerticalAligner/Alignment.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/VerticalAligner/Alignment.pm 2023-09-06 20:49:48.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/VerticalAligner/Alignment.pm 2023-09-12 21:44:21.000000000 +0200 @@ -10,7 +10,7 @@ { #<<< A non-indenting brace -our $VERSION = '20230909'; +our $VERSION = '20230912'; sub new { my ( $class, $rarg ) = @_; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/VerticalAligner/Line.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/VerticalAligner/Line.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/VerticalAligner/Line.pm 2023-09-06 20:49:48.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/VerticalAligner/Line.pm 2023-09-12 21:44:22.000000000 +0200 @@ -10,7 +10,7 @@ use strict; use warnings; use English qw( -no_match_vars ); -our $VERSION = '20230909'; +our $VERSION = '20230912'; sub AUTOLOAD { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy/VerticalAligner.pm new/Perl-Tidy-20230912/lib/Perl/Tidy/VerticalAligner.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy/VerticalAligner.pm 2023-09-06 20:49:47.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy/VerticalAligner.pm 2023-09-12 21:44:21.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use Carp; use English qw( -no_match_vars ); -our $VERSION = '20230909'; +our $VERSION = '20230912'; use Perl::Tidy::VerticalAligner::Alignment; use Perl::Tidy::VerticalAligner::Line; @@ -5582,7 +5582,7 @@ int( $leading_space_count / $rOpts_entab_leading_whitespace ); my $leading_string = "\t" x $tab_count . SPACE x $space_count; if ( $line =~ /^\s{$leading_space_count,$leading_space_count}/ ) { - substr( $line, 0, $leading_space_count ) = $leading_string; + substr( $line, 0, $leading_space_count, $leading_string ); } else { @@ -5617,7 +5617,7 @@ $leading_string .= ( SPACE x $space_count ); } if ( $line =~ /^\s{$leading_space_count,$leading_space_count}/ ) { - substr( $line, 0, $leading_space_count ) = $leading_string; + substr( $line, 0, $leading_space_count, $leading_string ); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy.pm new/Perl-Tidy-20230912/lib/Perl/Tidy.pm --- old/Perl-Tidy-20230909/lib/Perl/Tidy.pm 2023-09-06 20:49:37.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy.pm 2023-09-12 21:44:11.000000000 +0200 @@ -111,7 +111,7 @@ # then the Release version must be bumped, and it is probably past time for # a release anyway. - $VERSION = '20230909'; + $VERSION = '20230912'; } ## end BEGIN sub DESTROY { @@ -497,7 +497,6 @@ _prefilter_ => $i++, _rOpts_ => $i++, _saw_pbp_ => $i++, - _tabsize_ => $i++, _teefile_stream_ => $i++, _user_formatter_ => $i++, _input_copied_verbatim_ => $i++, @@ -2566,7 +2565,6 @@ my $length_function = $self->[_length_function_]; my $logger_object = $self->[_logger_object_]; my $rOpts = $self->[_rOpts_]; - my $tabsize = $self->[_tabsize_]; my $user_formatter = $self->[_user_formatter_]; # make a debugger object if requested @@ -2719,19 +2717,8 @@ logger_object => $logger_object, debugger_object => $debugger_object, diagnostics_object => $diagnostics_object, - tabsize => $tabsize, rOpts => $rOpts, - - starting_level => $rOpts->{'starting-indentation-level'}, - indent_columns => $rOpts->{'indent-columns'}, - look_for_hash_bang => $rOpts->{'look-for-hash-bang'}, - look_for_autoloader => $rOpts->{'look-for-autoloader'}, - look_for_selfloader => $rOpts->{'look-for-selfloader'}, - trim_qw => $rOpts->{'trim-qw'}, - extended_syntax => $rOpts->{'extended-syntax'}, - - continuation_indentation => $rOpts->{'continuation-indentation'}, - outdent_labels => $rOpts->{'outdent-labels'}, + starting_level => $rOpts->{'starting-indentation-level'}, ); #--------------------------------- @@ -4654,16 +4641,6 @@ $rOpts->{'logical-padding'} = 0; } - # Define $tabsize, the number of spaces per tab for use in - # guessing the indentation of source lines with leading tabs. - # Assume same as for this run if tabs are used, otherwise assume - # a default value, typically 8 - $self->[_tabsize_] = - $rOpts->{'entab-leading-whitespace'} - ? $rOpts->{'entab-leading-whitespace'} - : $rOpts->{'tabs'} ? $rOpts->{'indent-columns'} - : $rOpts->{'default-tabsize'}; - # Define the default line ending, before any -ple option is applied $self->[_line_separator_default_] = get_line_separator_default($rOpts); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/lib/Perl/Tidy.pod new/Perl-Tidy-20230912/lib/Perl/Tidy.pod --- old/Perl-Tidy-20230909/lib/Perl/Tidy.pod 2023-09-06 20:49:38.000000000 +0200 +++ new/Perl-Tidy-20230912/lib/Perl/Tidy.pod 2023-09-12 21:44:12.000000000 +0200 @@ -469,7 +469,7 @@ =head1 VERSION -This man page documents Perl::Tidy version 20230909 +This man page documents Perl::Tidy version 20230912 =head1 LICENSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Perl-Tidy-20230909/t/snippets28.t new/Perl-Tidy-20230912/t/snippets28.t --- old/Perl-Tidy-20230909/t/snippets28.t 2023-09-05 02:58:30.000000000 +0200 +++ new/Perl-Tidy-20230912/t/snippets28.t 2023-09-12 21:39:14.000000000 +0200 @@ -16,6 +16,7 @@ #13 lrt.lrt #14 ame.ame #15 ame.def +#16 git124.def # To locate test #13 you can search for its name or the string '#13' @@ -64,6 +65,17 @@ print join( "\n", @RPMOutput ) . "\n" unless $Quiet; ---------- + 'git124' => <<'----------', +sub git124 { + return [ + gather while ( my $foo = $bar->foobar ) + { + ...; + } + ]; +} +---------- + 'lrt' => <<'----------', =pod sub hello{ print @@ -365,6 +377,21 @@ elsif ( $level == 2 ) { $val = $global{'chapter'} } #15........... }, + + 'git124.def' => { + source => "git124", + params => "def", + expect => <<'#16...........', +sub git124 { + return [ + gather while ( my $foo = $bar->foobar ) + { + ...; + } + ]; +} +#16........... + }, }; my $ntests = 0 + keys %{$rtests};
participants (1)
-
Source-Sync