r71439 - in /trunk/libmouse-perl: ./ debian/ lib/ lib/Mouse/ lib/Mouse/Meta/ lib/Mouse/Meta/Method/ lib/Mouse/Meta/Role/ lib/Mouse/Util/ t/001_mouse/ xs-src/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Tue Mar 15 02:18:49 UTC 2011
Author: jawnsy-guest
Date: Tue Mar 15 02:18:30 2011
New Revision: 71439
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=71439
Log:
* New upstream release
* Bump to debhelper compat 8
Added:
trunk/libmouse-perl/t/001_mouse/072_tc_extra_args.t
- copied unchanged from r71424, branches/upstream/libmouse-perl/current/t/001_mouse/072_tc_extra_args.t
Modified:
trunk/libmouse-perl/Changes
trunk/libmouse-perl/MANIFEST
trunk/libmouse-perl/META.yml
trunk/libmouse-perl/debian/changelog
trunk/libmouse-perl/debian/compat
trunk/libmouse-perl/debian/control
trunk/libmouse-perl/lib/Mouse.pm
trunk/libmouse-perl/lib/Mouse/Exporter.pm
trunk/libmouse-perl/lib/Mouse/Meta/Attribute.pm
trunk/libmouse-perl/lib/Mouse/Meta/Class.pm
trunk/libmouse-perl/lib/Mouse/Meta/Method.pm
trunk/libmouse-perl/lib/Mouse/Meta/Method/Accessor.pm
trunk/libmouse-perl/lib/Mouse/Meta/Method/Constructor.pm
trunk/libmouse-perl/lib/Mouse/Meta/Method/Delegation.pm
trunk/libmouse-perl/lib/Mouse/Meta/Method/Destructor.pm
trunk/libmouse-perl/lib/Mouse/Meta/Module.pm
trunk/libmouse-perl/lib/Mouse/Meta/Role.pm
trunk/libmouse-perl/lib/Mouse/Meta/Role/Application.pm
trunk/libmouse-perl/lib/Mouse/Meta/Role/Composite.pm
trunk/libmouse-perl/lib/Mouse/Meta/Role/Method.pm
trunk/libmouse-perl/lib/Mouse/Meta/TypeConstraint.pm
trunk/libmouse-perl/lib/Mouse/Object.pm
trunk/libmouse-perl/lib/Mouse/PurePerl.pm
trunk/libmouse-perl/lib/Mouse/Role.pm
trunk/libmouse-perl/lib/Mouse/Spec.pm
trunk/libmouse-perl/lib/Mouse/Tiny.pod
trunk/libmouse-perl/lib/Mouse/Util.pm
trunk/libmouse-perl/lib/Mouse/Util/TypeConstraints.pm
trunk/libmouse-perl/lib/Mouse/XS.pod
trunk/libmouse-perl/xs-src/MouseTypeConstraints.xs
Modified: trunk/libmouse-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/Changes?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/Changes (original)
+++ trunk/libmouse-perl/Changes Tue Mar 15 02:18:30 2011
@@ -1,4 +1,9 @@
Revision history for Mouse
+
+0.91 2011-03-14 13:12:35
+ [CHANGES]
+ * $type_constraint->check() accepts extra arguments for extensibility
+ (requested by @lestrrat)
0.90 2011-02-21 10:48:58
[BUG FIXES]
Modified: trunk/libmouse-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/MANIFEST?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/MANIFEST (original)
+++ trunk/libmouse-perl/MANIFEST Tue Mar 15 02:18:30 2011
@@ -142,6 +142,7 @@
t/001_mouse/069-add-modifier.t
t/001_mouse/070-inherit-role-attr.t
t/001_mouse/071_tc_dualvar.t
+t/001_mouse/072_tc_extra_args.t
t/001_mouse/100-meta-class.t
t/001_mouse/101-meta-attribute.t
t/001_mouse/301-bugs-non-mouse.t
Modified: trunk/libmouse-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/META.yml?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/META.yml (original)
+++ trunk/libmouse-perl/META.yml Tue Mar 15 02:18:30 2011
@@ -31,4 +31,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: git://git.moose.perl.org/Mouse.git
-version: 0.90
+version: 0.91
Modified: trunk/libmouse-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/debian/changelog?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/debian/changelog (original)
+++ trunk/libmouse-perl/debian/changelog Tue Mar 15 02:18:30 2011
@@ -1,3 +1,10 @@
+libmouse-perl (0.91-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Bump to debhelper compat 8
+
+ -- Jonathan Yu <jawnsy at cpan.org> Mon, 14 Mar 2011 22:41:12 -0400
+
libmouse-perl (0.90-1) unstable; urgency=low
* New upstream release.
Modified: trunk/libmouse-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/debian/compat?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/debian/compat (original)
+++ trunk/libmouse-perl/debian/compat Tue Mar 15 02:18:30 2011
@@ -1,1 +1,1 @@
-7
+8
Modified: trunk/libmouse-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/debian/control?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/debian/control (original)
+++ trunk/libmouse-perl/debian/control Tue Mar 15 02:18:30 2011
@@ -1,11 +1,20 @@
Source: libmouse-perl
Section: perl
Priority: optional
-Build-Depends: perl (>= 5.10.1), debhelper (>= 7.0.50), libclass-method-modifiers-perl,
- libextutils-parsexs-perl (>= 2.210000), libio-string-perl, liblocale-us-perl,
- libmoose-perl (>= 0.93), libregexp-common-perl, libtest-deep-perl,
- libtest-leaktrace-perl, libtest-output-perl,
- liburi-perl, libparams-coerce-perl, libwww-perl, libpath-class-perl
+Build-Depends: perl (>= 5.10.1), debhelper (>= 8),
+ libclass-method-modifiers-perl,
+ libextutils-parsexs-perl (>= 2.210000),
+ libio-string-perl,
+ liblocale-us-perl,
+ libmoose-perl (>= 0.93),
+ libregexp-common-perl,
+ libtest-deep-perl,
+ libtest-leaktrace-perl,
+ libtest-output-perl,
+ liburi-perl,
+ libparams-coerce-perl,
+ libwww-perl,
+ libpath-class-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: gregor herrmann <gregoa at debian.org>,
Jose Luis Rivas <ghostbar at debian.org>, Brian Cassidy <brian.cassidy at gmail.com>,
Modified: trunk/libmouse-perl/lib/Mouse.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse.pm (original)
+++ trunk/libmouse-perl/lib/Mouse.pm Tue Mar 15 02:18:30 2011
@@ -3,7 +3,7 @@
use Mouse::Exporter; # enables strict and warnings
-our $VERSION = '0.90';
+our $VERSION = '0.91';
use Carp ();
use Scalar::Util ();
@@ -155,7 +155,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SYNOPSIS
Modified: trunk/libmouse-perl/lib/Mouse/Exporter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Exporter.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Exporter.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Exporter.pm Tue Mar 15 02:18:30 2011
@@ -267,7 +267,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SYNOPSIS
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Attribute.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Attribute.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Attribute.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Attribute.pm Tue Mar 15 02:18:30 2011
@@ -255,8 +255,15 @@
if(exists $attribute->{$type}){
my $generator = '_generate_' . $type;
my $code = $accessor_class->$generator($attribute, $metaclass);
- $metaclass->add_method($attribute->{$type} => $code);
- $attribute->associate_method($attribute->{$type});
+ my $name = $attribute->{$type};
+# TODO: do something for compatibility
+# if( $metaclass->name->can($name) ) {
+# my $t = $metaclass->has_method($name) ? 'method' : 'function';
+# Carp::cluck("You are overwriting a locally defined $t"
+# . " ($name) with an accessor");
+# }
+ $metaclass->add_method($name => $code);
+ $attribute->associate_method($name);
}
}
@@ -342,7 +349,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 DESCRIPTION
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Class.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Class.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Class.pm Tue Mar 15 02:18:30 2011
@@ -470,7 +470,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 DESCRIPTION
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Method.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Method.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Method.pm Tue Mar 15 02:18:30 2011
@@ -54,7 +54,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 DESCRIPTION
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Method/Accessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Method/Accessor.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Method/Accessor.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Method/Accessor.pm Tue Mar 15 02:18:30 2011
@@ -187,7 +187,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SEE ALSO
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Method/Constructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Method/Constructor.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Method/Constructor.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Method/Constructor.pm Tue Mar 15 02:18:30 2011
@@ -232,7 +232,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SEE ALSO
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Method/Delegation.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Method/Delegation.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Method/Delegation.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Method/Delegation.pm Tue Mar 15 02:18:30 2011
@@ -61,7 +61,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SEE ALSO
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Method/Destructor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Method/Destructor.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Method/Destructor.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Method/Destructor.pm Tue Mar 15 02:18:30 2011
@@ -65,7 +65,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SEE ALSO
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Module.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Module.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Module.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Module.pm Tue Mar 15 02:18:30 2011
@@ -311,7 +311,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 DESCRIPTION
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Role.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Role.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Role.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Role.pm Tue Mar 15 02:18:30 2011
@@ -131,7 +131,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 DESCRIPTION
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Role/Application.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Role/Application.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Role/Application.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Role/Application.pm Tue Mar 15 02:18:30 2011
@@ -209,7 +209,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SEE ALSO
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Role/Composite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Role/Composite.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Role/Composite.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Role/Composite.pm Tue Mar 15 02:18:30 2011
@@ -156,7 +156,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SEE ALSO
Modified: trunk/libmouse-perl/lib/Mouse/Meta/Role/Method.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/Role/Method.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/Role/Method.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/Role/Method.pm Tue Mar 15 02:18:30 2011
@@ -23,7 +23,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SEE ALSO
Modified: trunk/libmouse-perl/lib/Mouse/Meta/TypeConstraint.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Meta/TypeConstraint.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Meta/TypeConstraint.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Meta/TypeConstraint.pm Tue Mar 15 02:18:30 2011
@@ -276,7 +276,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 DESCRIPTION
Modified: trunk/libmouse-perl/lib/Mouse/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Object.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Object.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Object.pm Tue Mar 15 02:18:30 2011
@@ -16,7 +16,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 METHODS
Modified: trunk/libmouse-perl/lib/Mouse/PurePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/PurePerl.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/PurePerl.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/PurePerl.pm Tue Mar 15 02:18:30 2011
@@ -749,7 +749,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SEE ALSO
Modified: trunk/libmouse-perl/lib/Mouse/Role.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Role.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Role.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Role.pm Tue Mar 15 02:18:30 2011
@@ -1,7 +1,7 @@
package Mouse::Role;
use Mouse::Exporter; # enables strict and warnings
-our $VERSION = '0.90';
+our $VERSION = '0.91';
use Carp ();
use Scalar::Util ();
@@ -137,7 +137,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SYNOPSIS
Modified: trunk/libmouse-perl/lib/Mouse/Spec.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Spec.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Spec.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Spec.pm Tue Mar 15 02:18:30 2011
@@ -2,7 +2,7 @@
use strict;
use warnings;
-our $VERSION = '0.90';
+our $VERSION = '0.91';
our $MouseVersion = $VERSION;
our $MooseVersion = '1.13';
@@ -19,7 +19,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SYNOPSIS
Modified: trunk/libmouse-perl/lib/Mouse/Tiny.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Tiny.pod?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Tiny.pod (original)
+++ trunk/libmouse-perl/lib/Mouse/Tiny.pod Tue Mar 15 02:18:30 2011
@@ -5,7 +5,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 DESCRIPTION
Modified: trunk/libmouse-perl/lib/Mouse/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Util.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Util.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Util.pm Tue Mar 15 02:18:30 2011
@@ -50,7 +50,7 @@
},
);
- our $VERSION = '0.90';
+ our $VERSION = '0.91';
my $xs = !(defined(&is_valid_class_name) || $ENV{MOUSE_PUREPERL} || $ENV{PERL_ONLY});
@@ -388,7 +388,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 SYNOPSIS
Modified: trunk/libmouse-perl/lib/Mouse/Util/TypeConstraints.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/Util/TypeConstraints.pm?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/Util/TypeConstraints.pm (original)
+++ trunk/libmouse-perl/lib/Mouse/Util/TypeConstraints.pm Tue Mar 15 02:18:30 2011
@@ -432,7 +432,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head2 SYNOPSIS
Modified: trunk/libmouse-perl/lib/Mouse/XS.pod
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/lib/Mouse/XS.pod?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/lib/Mouse/XS.pod (original)
+++ trunk/libmouse-perl/lib/Mouse/XS.pod Tue Mar 15 02:18:30 2011
@@ -5,7 +5,7 @@
=head1 VERSION
-This document describes Mouse version 0.90
+This document describes Mouse version 0.91
=head1 DESCRIPTION
Modified: trunk/libmouse-perl/xs-src/MouseTypeConstraints.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmouse-perl/xs-src/MouseTypeConstraints.xs?rev=71439&op=diff
==============================================================================
--- trunk/libmouse-perl/xs-src/MouseTypeConstraints.xs (original)
+++ trunk/libmouse-perl/xs-src/MouseTypeConstraints.xs Tue Mar 15 02:18:30 2011
@@ -10,6 +10,14 @@
#define SvRXOK(sv) (SvROK(sv) && SvMAGICAL(SvRV(sv)) && mg_find(SvRV(sv), PERL_MAGIC_qr))
#endif
+#define MY_CXT_KEY "Mouse::Util::TypeConstraints::_guts" XS_VERSION
+typedef struct sui_cxt{
+ GV* universal_isa;
+ GV* universal_can;
+ AV* tc_extra_args;
+} my_cxt_t;
+START_MY_CXT
+
typedef int (*check_fptr_t)(pTHX_ SV* const data, SV* const sv);
static
@@ -36,12 +44,21 @@
else { /* custom */
int ok;
dSP;
+ dMY_CXT;
ENTER;
SAVETMPS;
PUSHMARK(SP);
XPUSHs(sv);
+ if( MY_CXT.tc_extra_args ) {
+ AV* const av = MY_CXT.tc_extra_args;
+ I32 const len = AvFILLp(av) + 1;
+ int i;
+ for(i = 0; i < len; i++) {
+ XPUSHs( AvARRAY(av)[i] );
+ }
+ }
PUTBACK;
call_sv(tc_code, G_SCALAR);
@@ -345,12 +362,6 @@
* This class_type generator is taken from Scalar::Util::Instance
*/
-#define MY_CXT_KEY "Mouse::Util::TypeConstraints::_guts" XS_VERSION
-typedef struct sui_cxt{
- GV* universal_isa;
- GV* universal_can;
-} my_cxt_t;
-START_MY_CXT
#define MG_klass_stash(mg) ((HV*)(mg)->mg_obj)
#define MG_klass_pv(mg) ((mg)->mg_ptr)
@@ -579,6 +590,8 @@
MY_CXT.universal_can = gv_fetchpvs("UNIVERSAL::can", GV_ADD, SVt_PVCV);
SvREFCNT_inc_simple_void_NN(MY_CXT.universal_can);
+
+ MY_CXT.tc_extra_args = NULL;
}
#define DEFINE_TC(name) mouse_tc_generate(aTHX_ "Mouse::Util::TypeConstraints::" STRINGIFY(name), CAT2(mouse_tc_, name), NULL)
@@ -804,7 +817,7 @@
}
bool
-check(SV* self, SV* sv)
+check(SV* self, SV* sv, ...)
CODE:
{
SV* const check = get_slots(self, "compiled_type_constraint");
@@ -812,6 +825,17 @@
mouse_throw_error(self, check,
"'%"SVf"' has no compiled type constraint", self);
}
+ if( items > 2 ) {
+ int i;
+ AV* av;
+ dMY_CXT;
+ SAVESPTR(MY_CXT.tc_extra_args);
+ av = MY_CXT.tc_extra_args = newAV_mortal();
+ av_extend(av, items - 3);
+ for(i = 2; i < items; i++) {
+ av_push(av, SvREFCNT_inc_NN( ST(i) ) );
+ }
+ }
RETVAL = mouse_tc_check(aTHX_ check, sv) ? TRUE : FALSE;
}
OUTPUT:
More information about the Pkg-perl-cvs-commits
mailing list