use XSLoader;
BEGIN {
- our $VERSION = '1.00_02';
+ our $VERSION = '1.0103_01';
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
XSLoader::load;
sub _assert_valid_attributes {
my ($attrs) = @_;
- $attrs =~ /^\s*:\s*[^\W\d]\w*\s*(?:(?:\s|:\s*)[^\W\d]\w*\s*)*(?:\(|\z)/
- or confess qq{"$attrs" doesn't look like valid attributes};
+ $attrs =~ m{
+ ^ \s*+
+ : \s*+
+ (?&ident) (?! [^\s:(] ) (?¶m)?+ \s*+
+ (?:
+ (?: : \s*+ )?
+ (?&ident) (?! [^\s:(] ) (?¶m)?+ \s*+
+ )*+
+ \z
+
+ (?(DEFINE)
+ (?<ident>
+ [^\W\d]
+ \w*+
+ )
+ (?<param>
+ \(
+ [^()\\]*+
+ (?:
+ (?:
+ \\ .
+ |
+ (?¶m)
+ )
+ [^()\\]*+
+ )*+
+ \)
+ )
+ )
+ }sx or confess qq{"$attrs" doesn't look like valid attributes};
}
my @bare_arms = qw(function method);
function, and returns either C<undef> (if it knows nothing about the function)
or a L<Function::Parameters::Info> object describing the parameter list.
+Note: This feature is implemented using L<Moo>, so you'll need to have L<Moo>
+installed if you want to call C<Function::Parameters::info> (alternatively, if
+L<Moose> is already loaded by the time C<Function::Parameters::info> is first
+called, it will use that instead).
+
See L<Function::Parameters::Info> for examples.
=head2 Wrapping C<Function::Parameters>
=head1 COPYRIGHT & LICENSE
-Copyright 2010, 2011, 2012 Lukas Mai.
+Copyright 2010-2013 Lukas Mai.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published