Hello community,
here is the log from the commit of package perl-Syntax-Keyword-Try for
openSUSE:Factory checked in at 2020-07-29 17:22:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Syntax-Keyword-Try (Old)
and /work/SRC/openSUSE:Factory/.perl-Syntax-Keyword-Try.new.3592 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Syntax-Keyword-Try"
Wed Jul 29 17:22:19 2020 rev:6 rq:823410 version:0.16
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Syntax-Keyword-Try/perl-Syntax-Keyword-Try.changes
2020-07-27 17:40:27.715003293 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Syntax-Keyword-Try.new.3592/perl-Syntax-Keyword-Try.changes
2020-07-29 17:23:49.284731858 +0200
@@ -1,0 +2,15 @@
+Wed Jul 29 03:12:34 UTC 2020 - Tina Müller <[email protected]>
+
+- updated to 0.16
+ see /usr/share/doc/packages/perl-Syntax-Keyword-Try/Changes
+
+ 0.16 2020-07-23
+ [CHANGES]
+ * Provide the `:experimental` import tag as a nicer way to silence
+ experimental warnings
+
+ [BUGFIXES]
+ * Don't name a variable `class` because it upsets some C compilers
+ (RT133043)
+
+-------------------------------------------------------------------
Old:
----
Syntax-Keyword-Try-0.15.tar.gz
New:
----
Syntax-Keyword-Try-0.16.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Syntax-Keyword-Try.spec ++++++
--- /var/tmp/diff_new_pack.MWRmgX/_old 2020-07-29 17:23:49.864732357 +0200
+++ /var/tmp/diff_new_pack.MWRmgX/_new 2020-07-29 17:23:49.868732360 +0200
@@ -17,7 +17,7 @@
Name: perl-Syntax-Keyword-Try
-Version: 0.15
+Version: 0.16
Release: 0
%define cpan_name Syntax-Keyword-Try
Summary: C<try/catch/finally> syntax for perl
++++++ Syntax-Keyword-Try-0.15.tar.gz -> Syntax-Keyword-Try-0.16.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Syntax-Keyword-Try-0.15/Changes
new/Syntax-Keyword-Try-0.16/Changes
--- old/Syntax-Keyword-Try-0.15/Changes 2020-07-21 01:06:22.000000000 +0200
+++ new/Syntax-Keyword-Try-0.16/Changes 2020-07-24 00:57:11.000000000 +0200
@@ -1,9 +1,20 @@
Revision history for Syntax-Keyword-Try
+0.16 2020-07-23
+ [CHANGES]
+ * Provide the `:experimental` import tag as a nicer way to silence
+ experimental warnings
+
+ [BUGFIXES]
+ * Don't name a variable `class` because it upsets some C compilers
+ (RT133043)
+
0.15 2020-07-21
+ [CHANGES]
* Experimental typed `catch (VAR ...)` conditions
0.14 2020-07-07
+ [CHANGES]
* Optional experimental syntax of `catch (VAR)` instead of previous
experimental `catch my VAR`
* Mark `catch my VAR` as deprecated
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Syntax-Keyword-Try-0.15/META.json
new/Syntax-Keyword-Try-0.16/META.json
--- old/Syntax-Keyword-Try-0.15/META.json 2020-07-21 01:06:22.000000000
+0200
+++ new/Syntax-Keyword-Try-0.16/META.json 2020-07-24 00:57:11.000000000
+0200
@@ -38,7 +38,7 @@
"provides" : {
"Syntax::Keyword::Try" : {
"file" : "lib/Syntax/Keyword/Try.pm",
- "version" : "0.15"
+ "version" : "0.16"
}
},
"release_status" : "stable",
@@ -48,6 +48,6 @@
],
"x_IRC" : "irc://irc.perl.org/#io-async"
},
- "version" : "0.15",
+ "version" : "0.16",
"x_serialization_backend" : "JSON::PP version 4.04"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Syntax-Keyword-Try-0.15/META.yml
new/Syntax-Keyword-Try-0.16/META.yml
--- old/Syntax-Keyword-Try-0.15/META.yml 2020-07-21 01:06:22.000000000
+0200
+++ new/Syntax-Keyword-Try-0.16/META.yml 2020-07-24 00:57:11.000000000
+0200
@@ -17,11 +17,11 @@
provides:
Syntax::Keyword::Try:
file: lib/Syntax/Keyword/Try.pm
- version: '0.15'
+ version: '0.16'
requires:
perl: '5.014'
resources:
IRC: irc://irc.perl.org/#io-async
license: http://dev.perl.org/licenses/
-version: '0.15'
+version: '0.16'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Syntax-Keyword-Try-0.15/README
new/Syntax-Keyword-Try-0.16/README
--- old/Syntax-Keyword-Try-0.15/README 2020-07-21 01:06:22.000000000 +0200
+++ new/Syntax-Keyword-Try-0.16/README 2020-07-24 00:57:11.000000000 +0200
@@ -4,19 +4,34 @@
SYNOPSIS
- use Syntax::Keyword::Try;
+ use Syntax::Keyword::Try;
- sub foo
- {
- try {
- attempt_a_thing();
- return "success";
- }
- catch {
- warn "It failed - $@";
- return "failure";
- }
- }
+ sub foo
+ {
+ try {
+ attempt_a_thing();
+ return "success";
+ }
+ catch {
+ warn "It failed - $@";
+ return "failure";
+ }
+ }
+
+ Or, to use the experimental syntax:
+
+ use Syntax::Keyword::Try qw( try :experimental )
+
+ sub foo {
+ try {
+ attempt_a_thing();
+ return "success";
+ }
+ catch ($e) {
+ warn "It failed - $e";
+ return "failure";
+ }
+ }
DESCRIPTION
@@ -30,6 +45,27 @@
implement parser plugins and manipulate optrees to provide new syntax
and behaviours for perl code.
+Experimental Features
+
+ Some of the features of this module are currently marked as
+ experimental. They will provoke warnings in the experimental category,
+ unless silenced.
+
+ You can silence this with no warnings 'experimental' but then that will
+ silence every experimental warning, which may hide others
+ unintentionally. For a more fine-grained approach you can instead use
+ the import line for this module to only silence this module's warnings
+ selectively:
+
+ use Syntax::Keyword::Try qw( try :experimental(var) );
+
+ use Syntax::Keyword::Try qw( try :experimental(typed) );
+
+ use Syntax::Keyword::Try qw( try :experimental ); # all of the above
+
+ Don't forget to import the main try symbol itself, to activate the
+ syntax.
+
KEYWORDS
try
@@ -93,7 +129,8 @@
can be introduced to store the exception in. This new form is
experimental and is likely to be expanded on in a future version, as
part of the wider attempt to introduce typed dispatch. Using it will
- provoke an experimental category warning on supporting perl versions.
+ provoke an experimental category warning on supporting perl versions,
+ unless silenced by importing the :experimental(var) tag (see above).
Presence of this catch statement causes any exception thrown by the
preceding try block to be non-fatal to the surrounding code. If the
@@ -122,7 +159,11 @@
Optionally, multiple catch statements can be provided, where each block
is given a guarding condition, to control whether or not it will catch
- particular exception values. Two kinds of condition are supported:
+ particular exception values. Use of this syntax will provoke an
+ experimental category warning on supporting perl versions, unless
+ silenced by importing the :experimental(typed) tag (see above).
+
+ Two kinds of condition are supported:
*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Syntax-Keyword-Try-0.15/lib/Syntax/Keyword/Try.pm
new/Syntax-Keyword-Try-0.16/lib/Syntax/Keyword/Try.pm
--- old/Syntax-Keyword-Try-0.15/lib/Syntax/Keyword/Try.pm 2020-07-21
01:06:22.000000000 +0200
+++ new/Syntax-Keyword-Try-0.16/lib/Syntax/Keyword/Try.pm 2020-07-24
00:57:11.000000000 +0200
@@ -3,7 +3,7 @@
#
# (C) Paul Evans, 2016-2019 -- [email protected]
-package Syntax::Keyword::Try 0.15;
+package Syntax::Keyword::Try 0.16;
use v5.14;
use warnings;
@@ -19,19 +19,34 @@
=head1 SYNOPSIS
- use Syntax::Keyword::Try;
+ use Syntax::Keyword::Try;
- sub foo
- {
- try {
- attempt_a_thing();
- return "success";
- }
- catch {
- warn "It failed - $@";
- return "failure";
- }
- }
+ sub foo
+ {
+ try {
+ attempt_a_thing();
+ return "success";
+ }
+ catch {
+ warn "It failed - $@";
+ return "failure";
+ }
+ }
+
+Or, to use the experimental syntax:
+
+ use Syntax::Keyword::Try qw( try :experimental )
+
+ sub foo {
+ try {
+ attempt_a_thing();
+ return "success";
+ }
+ catch ($e) {
+ warn "It failed - $e";
+ return "failure";
+ }
+ }
=head1 DESCRIPTION
@@ -45,6 +60,24 @@
plugins and manipulate optrees to provide new syntax and behaviours for perl
code.
+=head1 Experimental Features
+
+Some of the features of this module are currently marked as experimental. They
+will provoke warnings in the C<experimental> category, unless silenced.
+
+You can silence this with C<no warnings 'experimental'> but then that will
+silence every experimental warning, which may hide others unintentionally. For
+a more fine-grained approach you can instead use the import line for this
+module to only silence this module's warnings selectively:
+
+ use Syntax::Keyword::Try qw( try :experimental(var) );
+
+ use Syntax::Keyword::Try qw( try :experimental(typed) );
+
+ use Syntax::Keyword::Try qw( try :experimental ); # all of the above
+
+Don't forget to import the main C<try> symbol itself, to activate the syntax.
+
=cut
=head1 KEYWORDS
@@ -109,7 +142,8 @@
introduced to store the exception in. This new form is experimental and is
likely to be expanded on in a future version, as part of the wider attempt to
introduce typed dispatch. Using it will provoke an C<experimental> category
-warning on supporting perl versions.
+warning on supporting perl versions, unless silenced by importing the
+C<:experimental(var)> tag (see above).
Presence of this C<catch> statement causes any exception thrown by the
preceding C<try> block to be non-fatal to the surrounding code. If the
@@ -137,7 +171,11 @@
Optionally, multiple catch statements can be provided, where each block is
given a guarding condition, to control whether or not it will catch particular
-exception values. Two kinds of condition are supported:
+exception values. Use of this syntax will provoke an C<experimental> category
+warning on supporting perl versions, unless silenced by importing the
+C<:experimental(typed)> tag (see above).
+
+Two kinds of condition are supported:
=over 4
@@ -361,6 +399,8 @@
$class->import_into( $caller, @_ );
}
+my @EXPERIMENTAL = qw( var typed );
+
sub import_into
{
my $class = shift;
@@ -372,6 +412,14 @@
$^H{"Syntax::Keyword::Try/try"}++ if delete $syms{try};
$^H{"Syntax::Keyword::Try/try_value"}++ if delete $syms{try_value};
+ foreach ( @EXPERIMENTAL ) {
+ $^H{"Syntax::Keyword::Try/experimental($_)"}++ if delete
$syms{":experimental($_)"};
+ }
+
+ if( delete $syms{":experimental"} ) {
+ $^H{"Syntax::Keyword::Try/experimental($_)"}++ for @EXPERIMENTAL;
+ }
+
# Ignore requests for these, as they come automatically with `try`
delete @syms{qw( catch finally )};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Syntax-Keyword-Try-0.15/lib/Syntax/Keyword/Try.xs
new/Syntax-Keyword-Try-0.16/lib/Syntax/Keyword/Try.xs
--- old/Syntax-Keyword-Try-0.15/lib/Syntax/Keyword/Try.xs 2020-07-21
01:06:22.000000000 +0200
+++ new/Syntax-Keyword-Try-0.16/lib/Syntax/Keyword/Try.xs 2020-07-24
00:57:11.000000000 +0200
@@ -421,7 +421,7 @@
static XOP xop_isa;
/* Totally stolen from perl 5.32.0's pp.c */
-static bool sv_isa_sv(SV *sv, SV *class)
+static bool sv_isa_sv(SV *sv, SV *namesv)
{
if(!SvROK(sv) || !SvOBJECT(SvRV(sv)))
return FALSE;
@@ -429,9 +429,9 @@
/* TODO: ->isa invocation */
#if HAVE_PERL_VERSION(5,16,0)
- return sv_derived_from_sv(sv, class, 0);
+ return sv_derived_from_sv(sv, namesv, 0);
#else
- return sv_derived_from(sv, SvPV_nolen(class));
+ return sv_derived_from(sv, SvPV_nolen(namesv));
#endif
}
@@ -490,9 +490,14 @@
if(lex_consume("(")) {
PADOFFSET catchvar = 0;
+ bool warned = FALSE;
+
#ifdef WARN_EXPERIMENTAL
- Perl_ck_warner(aTHX_ packWARN(WARN_EXPERIMENTAL),
- "'catch (VAR)' syntax is experimental and may be changed or removed
without notice");
+ if(!hints || !hv_fetchs(hints, "Syntax::Keyword::Try/experimental(var)",
0)) {
+ warned = true;
+ Perl_ck_warner(aTHX_ packWARN(WARN_EXPERIMENTAL),
+ "'catch (VAR)' syntax is experimental and may be changed or removed
without notice");
+ }
#endif
lex_read_space(0);
catchvar = parse_lexvar();
@@ -533,6 +538,15 @@
condop = regexp;
}
+#ifdef WARN_EXPERIMENTAL
+ if(condop && !warned &&
+ (!hints || !hv_fetchs(hints,
"Syntax::Keyword::Try/experimental(typed)", 0))) {
+ warned = true;
+ Perl_ck_warner(aTHX_ packWARN(WARN_EXPERIMENTAL),
+ "typed catch syntax is experimental and may be changed or removed
without notice");
+ }
+#endif
+
if(!lex_consume(")"))
croak("Expected close paren for catch (VAR)");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Syntax-Keyword-Try-0.15/t/01trycatch.t
new/Syntax-Keyword-Try-0.16/t/01trycatch.t
--- old/Syntax-Keyword-Try-0.15/t/01trycatch.t 2020-07-21 01:06:22.000000000
+0200
+++ new/Syntax-Keyword-Try-0.16/t/01trycatch.t 2020-07-24 00:57:11.000000000
+0200
@@ -5,8 +5,6 @@
use Test::More;
-use constant HAVE_WARN_EXPERIMENTAL => $] >= 5.018;
-
use Syntax::Keyword::Try;
# try success
@@ -98,7 +96,7 @@
# catch into new lexical
{
- no if HAVE_WARN_EXPERIMENTAL, warnings => 'experimental';
+ use Syntax::Keyword::Try ':experimental(var)';
try {
die "caught\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Syntax-Keyword-Try-0.15/t/04catch-types.t
new/Syntax-Keyword-Try-0.16/t/04catch-types.t
--- old/Syntax-Keyword-Try-0.15/t/04catch-types.t 2020-07-21
01:06:22.000000000 +0200
+++ new/Syntax-Keyword-Try-0.16/t/04catch-types.t 2020-07-24
00:57:11.000000000 +0200
@@ -5,9 +5,7 @@
use Test::More;
-use Syntax::Keyword::Try;
-use constant HAVE_WARN_EXPERIMENTAL => $] >= 5.018;
-no if HAVE_WARN_EXPERIMENTAL, warnings => 'experimental';
+use Syntax::Keyword::Try qw( try :experimental );
sub func
{