Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-PPIx-QuoteLike for openSUSE:Factory checked in at 2022-04-14 17:25:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-PPIx-QuoteLike (Old) and /work/SRC/openSUSE:Factory/.perl-PPIx-QuoteLike.new.1941 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-PPIx-QuoteLike" Thu Apr 14 17:25:16 2022 rev:16 rq:969981 version:0.021 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-PPIx-QuoteLike/perl-PPIx-QuoteLike.changes 2022-03-26 22:31:06.049956498 +0100 +++ /work/SRC/openSUSE:Factory/.perl-PPIx-QuoteLike.new.1941/perl-PPIx-QuoteLike.changes 2022-04-14 17:25:49.215288270 +0200 @@ -1,0 +2,17 @@ +Wed Apr 6 03:13:00 UTC 2022 - Tina M??ller <timueller+p...@suse.de> + +- updated to 0.021 + see /usr/share/doc/packages/perl-PPIx-QuoteLike/Changes + + 0.021 2022-04-03 T. R. Wyant + Recognize postfix deref in '@{[ ... ]}' for determining minimum Perl + version. This recognizes all forms of postfix dereference, + including ->%*, ->&*, and ->**. NOTE that for now this remains a + PPIx::QuoteLike::Token::Interpolation. + Require PPI 1.238 for postfix deref support, and prune code that + dealt with PPI's old behavior. + Postfix %*, &*, and ** do not interpolate. + Correct perl_version_introduced() for interpolated postfix scalar + deref. + +------------------------------------------------------------------- Old: ---- PPIx-QuoteLike-0.020.tar.gz New: ---- PPIx-QuoteLike-0.021.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-PPIx-QuoteLike.spec ++++++ --- /var/tmp/diff_new_pack.S4gqit/_old 2022-04-14 17:25:49.967289148 +0200 +++ /var/tmp/diff_new_pack.S4gqit/_new 2022-04-14 17:25:49.971289153 +0200 @@ -18,7 +18,7 @@ %define cpan_name PPIx-QuoteLike Name: perl-PPIx-QuoteLike -Version: 0.020 +Version: 0.021 Release: 0 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Parse Perl string literals and string-literal-like things @@ -29,12 +29,12 @@ BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Module::Build) -BuildRequires: perl(PPI::Document) >= 1.117 -BuildRequires: perl(PPI::Dumper) >= 1.117 +BuildRequires: perl(PPI::Document) >= 1.238 +BuildRequires: perl(PPI::Dumper) >= 1.238 BuildRequires: perl(Readonly) BuildRequires: perl(Test::More) >= 0.88 -Requires: perl(PPI::Document) >= 1.117 -Requires: perl(PPI::Dumper) >= 1.117 +Requires: perl(PPI::Document) >= 1.238 +Requires: perl(PPI::Dumper) >= 1.238 Requires: perl(Readonly) %{perl_requires} ++++++ PPIx-QuoteLike-0.020.tar.gz -> PPIx-QuoteLike-0.021.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/Changes new/PPIx-QuoteLike-0.021/Changes --- old/PPIx-QuoteLike-0.020/Changes 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/Changes 2022-04-03 15:26:06.000000000 +0200 @@ -1,3 +1,17 @@ +0.021 2022-04-03 T. R. Wyant + Recognize postfix deref in '@{[ ... ]}' for determining minimum Perl + version. This recognizes all forms of postfix dereference, + including ->%*, ->&*, and ->**. NOTE that for now this remains a + PPIx::QuoteLike::Token::Interpolation. + + Require PPI 1.238 for postfix deref support, and prune code that + dealt with PPI's old behavior. + + Postfix %*, &*, and ** do not interpolate. + + Correct perl_version_introduced() for interpolated postfix scalar + deref. + 0.020 2022-03-17 T. R. Wyant Correct and optimize the computation of logical column position (the one that takes account of tabs). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/META.json new/PPIx-QuoteLike-0.021/META.json --- old/PPIx-QuoteLike-0.020/META.json 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/META.json 2022-04-03 15:26:06.000000000 +0200 @@ -41,8 +41,8 @@ "Encode" : "0", "Exporter" : "0", "List::Util" : "0", - "PPI::Document" : "1.117", - "PPI::Dumper" : "1.117", + "PPI::Document" : "1.238", + "PPI::Dumper" : "1.238", "Readonly" : "0", "Scalar::Util" : "0", "base" : "0", @@ -57,51 +57,51 @@ "provides" : { "PPIx::QuoteLike" : { "file" : "lib/PPIx/QuoteLike.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Constant" : { "file" : "lib/PPIx/QuoteLike/Constant.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Dumper" : { "file" : "lib/PPIx/QuoteLike/Dumper.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Token" : { "file" : "lib/PPIx/QuoteLike/Token.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Token::Control" : { "file" : "lib/PPIx/QuoteLike/Token/Control.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Token::Delimiter" : { "file" : "lib/PPIx/QuoteLike/Token/Delimiter.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Token::Interpolation" : { "file" : "lib/PPIx/QuoteLike/Token/Interpolation.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Token::String" : { "file" : "lib/PPIx/QuoteLike/Token/String.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Token::Structure" : { "file" : "lib/PPIx/QuoteLike/Token/Structure.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Token::Unknown" : { "file" : "lib/PPIx/QuoteLike/Token/Unknown.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Token::Whitespace" : { "file" : "lib/PPIx/QuoteLike/Token/Whitespace.pm", - "version" : "0.020" + "version" : "0.021" }, "PPIx::QuoteLike::Utils" : { "file" : "lib/PPIx/QuoteLike/Utils.pm", - "version" : "0.020" + "version" : "0.021" } }, "release_status" : "stable", @@ -119,6 +119,6 @@ "web" : "https://github.com/trwyant/perl-PPIx-QuoteLike" } }, - "version" : "0.020", + "version" : "0.021", "x_serialization_backend" : "JSON::PP version 4.07" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/META.yml new/PPIx-QuoteLike-0.021/META.yml --- old/PPIx-QuoteLike-0.020/META.yml 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/META.yml 2022-04-03 15:26:06.000000000 +0200 @@ -25,47 +25,47 @@ provides: PPIx::QuoteLike: file: lib/PPIx/QuoteLike.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Constant: file: lib/PPIx/QuoteLike/Constant.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Dumper: file: lib/PPIx/QuoteLike/Dumper.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Token: file: lib/PPIx/QuoteLike/Token.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Token::Control: file: lib/PPIx/QuoteLike/Token/Control.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Token::Delimiter: file: lib/PPIx/QuoteLike/Token/Delimiter.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Token::Interpolation: file: lib/PPIx/QuoteLike/Token/Interpolation.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Token::String: file: lib/PPIx/QuoteLike/Token/String.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Token::Structure: file: lib/PPIx/QuoteLike/Token/Structure.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Token::Unknown: file: lib/PPIx/QuoteLike/Token/Unknown.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Token::Whitespace: file: lib/PPIx/QuoteLike/Token/Whitespace.pm - version: '0.020' + version: '0.021' PPIx::QuoteLike::Utils: file: lib/PPIx/QuoteLike/Utils.pm - version: '0.020' + version: '0.021' requires: Carp: '0' Encode: '0' Exporter: '0' List::Util: '0' - PPI::Document: '1.117' - PPI::Dumper: '1.117' + PPI::Document: '1.238' + PPI::Dumper: '1.238' Readonly: '0' Scalar::Util: '0' base: '0' @@ -78,5 +78,5 @@ bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=PPIx-QuoteLike license: http://dev.perl.org/licenses/ repository: git://github.com/trwyant/perl-PPIx-QuoteLike.git -version: '0.020' +version: '0.021' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/eg/pqldump new/PPIx-QuoteLike-0.021/eg/pqldump --- old/PPIx-QuoteLike-0.020/eg/pqldump 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/eg/pqldump 2022-04-03 15:26:06.000000000 +0200 @@ -9,7 +9,7 @@ use Pod::Usage; use PPIx::QuoteLike::Dumper; -our $VERSION = '0.020'; +our $VERSION = '0.021'; my %opt; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/eg/variables new/PPIx-QuoteLike-0.021/eg/variables --- old/PPIx-QuoteLike-0.020/eg/variables 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/eg/variables 2022-04-03 15:26:06.000000000 +0200 @@ -10,7 +10,7 @@ use PPI::Document; use PPIx::QuoteLike::Utils qw{ __variables }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; my %opt; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/inc/My/Module/Meta.pm new/PPIx-QuoteLike-0.021/inc/My/Module/Meta.pm --- old/PPIx-QuoteLike-0.020/inc/My/Module/Meta.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/inc/My/Module/Meta.pm 2022-04-03 15:26:06.000000000 +0200 @@ -149,8 +149,8 @@ 'Encode' => 0, 'Exporter' => 0, 'List::Util' => 0, - 'PPI::Document' => 1.117, - 'PPI::Dumper' => 1.117, + 'PPI::Document' => 1.238, # for postfix deref + 'PPI::Dumper' => 1.238, 'Readonly' => 0, 'Scalar::Util' => 0, base => 0, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/inc/My/Module/Recommend/Any.pm new/PPIx-QuoteLike-0.021/inc/My/Module/Recommend/Any.pm --- old/PPIx-QuoteLike-0.020/inc/My/Module/Recommend/Any.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/inc/My/Module/Recommend/Any.pm 2022-04-03 15:26:06.000000000 +0200 @@ -12,7 +12,7 @@ BEGIN { *import = \&Exporter::import; } -our $VERSION = '0.020'; +our $VERSION = '0.021'; our @EXPORT_OK = qw{ __any }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Constant.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Constant.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Constant.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Constant.pm 2022-04-03 15:26:06.000000000 +0200 @@ -8,7 +8,7 @@ use Carp; use base qw{ Exporter }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; no warnings qw{ once }; # For older Perls. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Dumper.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Dumper.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Dumper.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Dumper.pm 2022-04-03 15:26:06.000000000 +0200 @@ -12,7 +12,7 @@ use PPIx::QuoteLike::Utils qw{ __instance }; use Scalar::Util (); -our $VERSION = '0.020'; +our $VERSION = '0.021'; use constant SCALAR_REF => ref \0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Control.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Control.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Control.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Control.pm 2022-04-03 15:26:06.000000000 +0200 @@ -9,7 +9,7 @@ use PPIx::QuoteLike::Constant qw{ @CARP_NOT }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; { # TODO make this a state variable when we can require Perl 5.10. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Delimiter.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Delimiter.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Delimiter.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Delimiter.pm 2022-04-03 15:26:06.000000000 +0200 @@ -9,7 +9,7 @@ use PPIx::QuoteLike::Constant qw{ MINIMUM_PERL @CARP_NOT }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; # Perl 5.29.0 disallows unassigned code points and combining code points # as delimiters. Unfortunately for me non-characters and illegal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Interpolation.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Interpolation.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Interpolation.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Interpolation.pm 2022-04-03 15:26:06.000000000 +0200 @@ -20,7 +20,7 @@ use base qw{ PPIx::QuoteLike::Token }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; sub ppi { my ( $self ) = @_; @@ -76,7 +76,7 @@ sub __perl_version_introduced { my ( $self ) = @_; - $self->content() =~ m/ -> (?: \@ [[{*] | % [*] ) /smx + $self->{postderef} and return '5.019005'; return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/String.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/String.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/String.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/String.pm 2022-04-03 15:26:06.000000000 +0200 @@ -9,7 +9,7 @@ use PPIx::QuoteLike::Constant qw{ @CARP_NOT }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Structure.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Structure.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Structure.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Structure.pm 2022-04-03 15:26:06.000000000 +0200 @@ -9,7 +9,7 @@ use PPIx::QuoteLike::Constant qw{ @CARP_NOT }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Unknown.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Unknown.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Unknown.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Unknown.pm 2022-04-03 15:26:06.000000000 +0200 @@ -9,7 +9,7 @@ use PPIx::QuoteLike::Constant qw{ @CARP_NOT }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Whitespace.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Whitespace.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token/Whitespace.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token/Whitespace.pm 2022-04-03 15:26:06.000000000 +0200 @@ -9,7 +9,7 @@ use PPIx::QuoteLike::Constant qw{ @CARP_NOT }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; sub significant { return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Token.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Token.pm 2022-04-03 15:26:06.000000000 +0200 @@ -16,7 +16,7 @@ visual_column_number }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; # Private to this package. sub __new { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Utils.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Utils.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike/Utils.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike/Utils.pm 2022-04-03 15:26:06.000000000 +0200 @@ -39,7 +39,7 @@ __variables }; -our $VERSION = '0.020'; +our $VERSION = '0.021'; # Readonly::Scalar my $BRACED_RE => __match_enclosed( LEFT_CURLY ); Readonly::Scalar my $BRACKETED_RE => __match_enclosed( '[' ); # ] @@ -89,9 +89,6 @@ return; } - # TODO make these state varables once we can require Perl 5.10. - my $postderef = { map { $_ => 1 } qw{ @* %* } }; - my $cast_allowed_for_bare_bracketed_variable = { map { $_ => 1 } qw{ @ $ % } }; @@ -144,17 +141,6 @@ 'PPIx::QuoteLike::Token'; foreach my $sym ( _find( $ppi, 'PPI::Token::Symbol' ) ) { - # The problem we're solving here is that PPI parses postfix - # dereference as though it makes reference to non-existent - # punctuation variables '@*' or '%*'. The following - # statement omits these from output if they are preceded by - # the '->' operator. - my $prev; - $postderef->{ $sym->content() } - and $prev = $sym->sprevious_sibling() - and $prev->isa( 'PPI::Token::Operator' ) - and '->' eq $prev->content() - and next; # Eliminate rogue subscripts _is_bareword_subscript( $sym ) and next; @@ -386,7 +372,7 @@ # Based on Regexp::Common $RE{delimited}{-delim=>'`'} return ( $REGEXP_CACHE{$ql} ||= - qr< (?: + qr< ( (?: \Q$left\E ) (?: [^\\\Q$left\E]* (?: \\ . [^\\\Q$left\E]* )* ) (?: \Q$left\E ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike.pm new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike.pm --- old/PPIx-QuoteLike-0.020/lib/PPIx/QuoteLike.pm 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/lib/PPIx/QuoteLike.pm 2022-04-03 15:26:06.000000000 +0200 @@ -39,7 +39,7 @@ }; use Scalar::Util (); -our $VERSION = '0.020'; +our $VERSION = '0.021'; use constant CLASS_CONTROL => 'PPIx::QuoteLike::Token::Control'; use constant CLASS_DELIMITER => 'PPIx::QuoteLike::Token::Delimiter'; @@ -709,8 +709,17 @@ if ( $_[2] =~ m/ \G (?= \{ ) /smxgc ) { # variable name enclosed in {} my $delim_re = __match_enclosed( qw< { > ); - $_[2] =~ m/ \G ( $delim_re ) /smxgc - and return [ CLASS_INTERPOLATION, "$sigil$1" ]; + if ( $_[2] =~ m/ \G $delim_re /smxgc ) { + my $rest = $1; + $rest =~ m/ \A \{ \s* \[ ( .* ) \] \s* \} \z /smx + or return [ CLASS_INTERPOLATION, "$sigil$rest" ]; + # At this point we have @{[ ... ]}. + my @arg; + $self->postderef() + and _has_postderef( "$1" ) + and push @arg, postderef => 1; + return [ CLASS_INTERPOLATION, "$sigil$rest", @arg ]; + } $_[2] =~ m/ \G ( .* ) /smxgc and return [ CLASS_UNKNOWN, "$sigil$1", error => MISMATCHED_DELIM ]; @@ -735,12 +744,15 @@ } } + my @arg; + if ( $self->postderef() and defined( my $deref = _match_postderef( $_[2] ) ) ) { $interp .= $deref; + push @arg, postderef => 1; } - return [ CLASS_INTERPOLATION, $interp ]; + return [ CLASS_INTERPOLATION, $interp, @arg ]; } my $code; @@ -784,7 +796,8 @@ # This would all be much easier if I could count on Perl 5.10 sub _match_postderef { ## no critic (RequireArgUnpacking) my $pos = pos $_[0]; - $_[0] =~ m/ \G ( -> ) ( \$ \# | [\$\@%&*] ) /smxgc + # Only scalars and arrays interpolate + $_[0] =~ m/ \G ( -> ) ( \$ \# | [\$\@] ) /smxgc or return; my $match = "$1$2"; my $sigil = $2; @@ -805,6 +818,37 @@ } } +{ + no warnings qw{ qw }; ## no critic (ProhibitNoWarnings) + my %is_postderef = map { $_ => 1 } qw{ $ $# @ % & * $* $#* @* %* &* ** }; + sub _has_postderef { + my ( $string ) = @_; + my $doc = PPI::Document->new( \$string ); + foreach my $elem ( @{ $doc->find( 'PPI::Token::Symbol' ) || [] } ) { + my $next = $elem->snext_sibling() + or next; + $next->isa( 'PPI::Token::Operator' ) + or next; + $next->content() eq '->' + or next; + $next = $next->snext_sibling() + or next; + $next->isa( 'PPI::Token::Cast' ) + or next; + my $content = $next->content(); + $is_postderef{$content} + or next; + $content =~ m/ \* \z /smx + and return 1; + $next = $next->snext_sibling() + or next; + $next->isa( 'PPI::Structure::Subscript' ) + and return 1; + } + return 0; + } +} + # For various reasons we may get consecutive literals -- typically # strings. We want to merge these. The arguments are array refs, with # the class name of the token in [0] and the content in [1]. I know of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/PPIx-QuoteLike-0.020/t/version.t new/PPIx-QuoteLike-0.021/t/version.t --- old/PPIx-QuoteLike-0.020/t/version.t 2022-03-17 16:32:01.000000000 +0100 +++ new/PPIx-QuoteLike-0.021/t/version.t 2022-04-03 15:26:06.000000000 +0200 @@ -96,11 +96,6 @@ 'Interpolation was introduced in 5.0'; is $tok->perl_version_removed(), undef, 'Interpolation is still here'; -$tok = PPIx::QuoteLike::Token::Interpolation->__new( content => '$x->@*' ); -is $tok->perl_version_introduced(), '5.019005', - 'Postfix dereference was introduced in 5.19.5'; -is $tok->perl_version_removed(), undef, 'Postfix dereference is still here'; - my $obj; $obj = PPIx::QuoteLike->new( '"foo$bar"' ); @@ -113,6 +108,27 @@ 'Case-folded string was introduced in 5.15.8'; is $obj->perl_version_removed(), undef, 'Case-folded string is still here'; +# NOTE Can not use qw{} below because of '$#'. +foreach my $sigil ( '$', '$#', '@' ) { + $obj = PPIx::QuoteLike->new( qq/"\$x->$sigil*"/ ); + is $obj->perl_version_introduced(), '5.019005', + "Postfix dereference $sigil was introduced in 5.19.5"; + is $tok->perl_version_removed(), undef, + "Postfix dereference $sigil is still here"; +} + +foreach my $sigil ( qw{ % & * } ) { + $obj = PPIx::QuoteLike->new( qq/"\$x->$sigil*"/ ); + is $obj->perl_version_introduced(), '5.000', + "\$->${sigil}* does not interpolate as postfix dereference"; +} + +foreach my $sigil ( qw{ % & * } ) { + $obj = PPIx::QuoteLike->new( qq/"\@{[\$x->$sigil*]}"/ ); + is $obj->perl_version_introduced(), '5.019005', + "\@{[\$x->$sigil*]} interpolates as postfix dereference"; +} + $obj = PPIx::QuoteLike->new( <<HERE_DOC ); <<~'EOD' How doth the little crocodile