sub _inline_copy_old_value {
my ( $self, $slot_access ) = @_;
- return '[ @{' . $slot_access . '} ]';
+ return '[ @{(' . $slot_access . ')} ]';
}
1;
sub _return_value {
my ( $self, $slot_access ) = @_;
- return "scalar \@{ $slot_access }";
+ return "scalar \@{ ($slot_access) }";
}
no Moose::Role;
my ( $self, $slot_access ) = @_;
return
- "( do { my \@potential = \@{ $slot_access }; \@return = splice \@potential, \$_[0], 1; \\\@potential } )";
+ "( do { my \@potential = \@{ ($slot_access) }; \@return = splice \@potential, \$_[0], 1; \\\@potential } )";
}
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "\@return = splice \@{ $slot_access }, \$_[0], 1";
+ return "\@return = splice \@{ ($slot_access) }, \$_[0], 1";
}
sub _return_value {
my $self = shift;
my $slot_access = shift;
- return "\@{ $slot_access }";
+ return "\@{ ($slot_access) }";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "&List::Util::first( \$_[0], \@{ ${slot_access} } )";
+ return "&List::Util::first( \$_[0], \@{ ($slot_access) } )";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "grep { \$_[0]->() } \@{ $slot_access }";
+ return "grep { \$_[0]->() } \@{ ($slot_access) }";
}
no Moose::Role;
my ( $self, $slot_access ) = @_;
return
- "( do { my \@potential = \@{ $slot_access }; splice \@potential, \$_[0], 0, \$_[1]; \\\@potential } )";
+ "( do { my \@potential = \@{ ($slot_access) }; splice \@potential, \$_[0], 0, \$_[1]; \\\@potential } )";
}
sub _new_members { '$_[1]' }
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "splice \@{ $slot_access }, \$_[0], 0, \$_[1];";
+ return "splice \@{ ($slot_access) }, \$_[0], 0, \$_[1];";
}
sub _return_value {
my $self = shift;
my $slot_access = shift;
- return "\@{ $slot_access } ? 0 : 1";
+ return "\@{ ($slot_access) } ? 0 : 1";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "join \$_[0], \@{ $slot_access }";
+ return "join \$_[0], \@{ ($slot_access) }";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "map { \$_[0]->() } \@{ $slot_access }";
+ return "map { \$_[0]->() } \@{ ($slot_access) }";
}
no Moose::Role;
my ( $self, $slot_access ) = @_;
return
- "my \$iter = List::MoreUtils::natatime( \$_[0], \@{ $slot_access } );"
+ "my \$iter = List::MoreUtils::natatime( \$_[0], \@{ ($slot_access) } );"
. "\n"
. 'if ( $_[1] ) {' . "\n"
. 'while (my @vals = $iter->()) {' . "\n"
sub _potential_value {
my ( $self, $slot_access ) = @_;
- return "[ \@{ $slot_access } > 1 ? \@{ $slot_access }[ 0 .. \$#{ $slot_access } - 1 ] : () ]";
+ return "[ \@{ ($slot_access) } > 1 ? \@{ ($slot_access) }[ 0 .. \$#{ ($slot_access) } - 1 ] : () ]";
}
sub _inline_capture_return_value {
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "pop \@{ $slot_access }";
+ return "pop \@{ ($slot_access) }";
}
sub _return_value {
sub _potential_value {
my ( $self, $slot_access ) = @_;
- return "[ \@{ $slot_access }, \@_ ]";
+ return "[ \@{ ($slot_access) }, \@_ ]";
}
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "push \@{ $slot_access }, \@_";
+ return "push \@{ ($slot_access) }, \@_";
}
sub _return_value {
my ( $self, $slot_access ) = @_;
- return "return scalar \@{ $slot_access }";
+ return "return scalar \@{ ($slot_access) }";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "List::Util::reduce { \$_[0]->( \$a, \$b ) } \@{ ${slot_access} }";
+ return "List::Util::reduce { \$_[0]->( \$a, \$b ) } \@{ ($slot_access) }";
}
no Moose::Role;
my ( $self, $slot_access ) = @_;
return
- "( do { my \@potential = \@{ $slot_access }; \$potential[ \$_[0] ] = \$_[1]; \\\@potential } )";
+ "( do { my \@potential = \@{ ($slot_access) }; \$potential[ \$_[0] ] = \$_[1]; \\\@potential } )";
}
sub _new_members { '$_[1]' }
sub _potential_value {
my ( $self, $slot_access ) = @_;
- return "[ \@{ $slot_access } > 1 ? \@{ $slot_access }[ 1 .. \$#{ $slot_access } ] : () ]";
+ return "[ \@{ ($slot_access) } > 1 ? \@{ ($slot_access) }[ 1 .. \$#{ ($slot_access) } ] : () ]";
}
sub _inline_capture_return_value {
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "shift \@{ $slot_access };";
+ return "shift \@{ ($slot_access) };";
}
sub _return_value {
my $self = shift;
my $slot_access = shift;
- return "List::Util::shuffle \@{ $slot_access }";
+ return "List::Util::shuffle \@{ ($slot_access) }";
}
no Moose::Role;
my $slot_access = shift;
return
- "\$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ ${slot_access} } : sort \@{ $slot_access }";
+ "\$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ ($slot_access) } : sort \@{ ($slot_access) }";
}
no Moose::Role;
my ( $self, $slot_access ) = @_;
return
- "[ \$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ $slot_access } : sort \@{ $slot_access} ]";
+ "[ \$_[0] ? sort { \$_[0]->( \$a, \$b ) } \@{ ($slot_access) } : sort \@{ ($slot_access) } ]";
}
sub _return_value { return q{} }
sub _potential_value {
my ( $self, $slot_access ) = @_;
- return "( do { my \@potential = \@{ $slot_access };"
+ return "( do { my \@potential = \@{ ($slot_access) };"
. '@return = defined $len ? ( splice @potential, $idx, $len, @_ ) : ( splice @potential, $idx ); \\@potential } )';
}
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "\@return = defined \$len ? ( splice \@{ $slot_access }, \$idx, \$len, \@_ ) : ( splice \@{ $slot_access }, \$idx )";
+ return "\@return = defined \$len ? ( splice \@{ ($slot_access) }, \$idx, \$len, \@_ ) : ( splice \@{ ($slot_access) }, \$idx )";
}
sub _return_value {
my $self = shift;
my $slot_access = shift;
- return "List::MoreUtils::uniq \@{ $slot_access }";
+ return "List::MoreUtils::uniq \@{ ($slot_access) }";
}
no Moose::Role;
sub _potential_value {
my ( $self, $slot_access ) = @_;
- return "[ \@_, \@{ $slot_access } ]";
+ return "[ \@_, \@{ ($slot_access) } ]";
}
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "unshift \@{ $slot_access }, \@_";
+ return "unshift \@{ ($slot_access) }, \@_";
}
sub _return_value {
my ( $self, $slot_access ) = @_;
- return "return scalar \@{ $slot_access }";
+ return "return scalar \@{ ($slot_access) }";
}
no Moose::Role;
sub _inline_copy_old_value {
my ( $self, $slot_access ) = @_;
- return '{ %{' . $slot_access . '} }';
+ return '{ %{(' . $slot_access . ')} }';
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "scalar keys \%{ $slot_access }";
+ return "scalar keys \%{ ($slot_access) }";
}
no Moose::Role;
sub _potential_value {
my ( $self, $slot_access ) = @_;
- return "( do { my \%potential = %{ $slot_access }; \@return = delete \@potential{\@_}; \\\%potential; } )";
+ return "( do { my \%potential = %{ ($slot_access) }; \@return = delete \@potential{\@_}; \\\%potential; } )";
}
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "\@return = delete \@{ $slot_access }{\@_}";
+ return "\@return = delete \@{ ($slot_access) }{\@_}";
}
sub _return_value {
my $self = shift;
my $slot_access = shift;
- return "map { \$_, ${slot_access}->{\$_} } keys \%{ $slot_access }";
+ return "map { \$_, ${slot_access}->{\$_} } keys \%{ ($slot_access) }";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "\@_ > 1 ? \@{ $slot_access }{\@_} : ${slot_access}->{ \$_[0] }";
+ return "\@_ > 1 ? \@{ ($slot_access) }{\@_} : ${slot_access}->{ \$_[0] }";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "scalar keys \%{ $slot_access } ? 0 : 1";
+ return "scalar keys \%{ ($slot_access) } ? 0 : 1";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "keys \%{ $slot_access }";
+ return "keys \%{ ($slot_access) }";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "map { [ \$_, ${slot_access}->{\$_} ] } keys \%{ $slot_access }";
+ return "map { [ \$_, ${slot_access}->{\$_} ] } keys \%{ ($slot_access) }";
}
no Moose::Role;
sub _potential_value {
my ( $self, $slot_access ) = @_;
- return "{ %{ $slot_access }, \@_ }";
+ return "{ %{ ($slot_access) }, \@_ }";
}
sub _new_members { '@_[ @values_idx ]' }
sub _inline_optimized_set_new_value {
my ( $self, $inv, $new, $slot_access ) = @_;
- return "\@{ $slot_access }{ \@_[ \@keys_idx] } = \@_[ \@values_idx ]";
+ return "\@{ ($slot_access) }{ \@_[ \@keys_idx] } = \@_[ \@values_idx ]";
}
sub _return_value {
my ( $self, $slot_access ) = @_;
- return "return wantarray ? \@{ $slot_access }{ \@_[ \@keys_idx ] } : ${slot_access}->{ \$_[ \$keys_idx[0] ] };";
+ return "return wantarray ? \@{ ($slot_access) }{ \@_[ \@keys_idx ] } : ${slot_access}->{ \$_[ \$keys_idx[0] ] };";
}
no Moose::Role;
my $self = shift;
my $slot_access = shift;
- return "values \%{ $slot_access }";
+ return "values \%{ ($slot_access) }";
}
no Moose::Role;