Skip to content

Commit

Permalink
Fix .<>, .[], and .{} in smart matching (RT #61136)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Mar 1, 2009
1 parent 1e22a68 commit 7bd5a95
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/parser/actions.pm
Expand Up @@ -3048,20 +3048,16 @@ sub transform_to_multi($past) {
# by infix:~~ and the when statement.
sub process_smartmatch($lhs, $rhs, $rhs_pt) {
if $rhs_pt<noun><dotty> {
# Method truth - just call RHS.
# method truth
$rhs<invocant_holder>[0] := $lhs;
return PAST::Op.new(
:pasttype('call'),
:name('prefix:?'),
$rhs
);
if $rhs_pt<noun><dotty><dottyop><postcircumfix> {
# array/hash slice truth
$rhs := PAST::Op.new( :pasttype('call'), :name('all'), $rhs);
}
return PAST::Op.new( :pasttype('call'), :name('prefix:?'), $rhs);
}
else {
return PAST::Op.new(
:pasttype('call'),
:name('infix:~~'),
$lhs, $rhs
);
return PAST::Op.new( :pasttype('call'), :name('infix:~~'), $lhs, $rhs);
}
}

Expand Down

0 comments on commit 7bd5a95

Please sign in to comment.