1 package MooseX::Meta::TypeConstraint::Structured::Positionable;
8 use base 'Moose::Meta::TypeConstraint::Parameterizable';
9 use Moose::Util::TypeConstraints ();
10 use MooseX::Meta::TypeConstraint::Structured::Positional;
13 my $indirection = qr{=>};
14 my $divider_ops = qr{ $comma | $indirection }x;
15 my $structure_divider = qr{\s* $divider_ops \s*}x;
17 sub parse_parameter_str {
18 my ($self, $type_str) = @_;
19 my @type_strs = split($structure_divider, $type_str);
20 return map {Moose::Util::TypeConstraints::find_or_create_isa_type_constraint($_)} @type_strs;
24 my ($self, @contained_tcs) = @_;
25 my $tc_name = $self->name .'['. join(',', map {$_->name} @contained_tcs) .']';
27 return MooseX::Meta::TypeConstraint::Structured::Positional->new(
29 parent => Moose::Util::TypeConstraints::find_type_constraint('ArrayRef'),
30 package_defined_in => __PACKAGE__,
31 signature => \@contained_tcs,