Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #556 from cognominal/nom
fix to support things like is equiv('>+<')
  • Loading branch information
lizmat committed Oct 17, 2015
2 parents d147280 + fe31c4b commit d8d6abd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/operators.pm
Expand Up @@ -635,7 +635,7 @@ sub infix:<orelse>(**@a) {
# so early in the setting compunit
multi sub trait_mod:<is>(Routine $r, Str :$equiv!) {
if (my $i = nqp::index($r.name, ':')) > 0 {
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~ $equiv ~ '>';
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~ nqp::escape($equiv) ~ '>';
trait_mod:<is>($r, equiv => ::(nm));
return;
}
Expand All @@ -644,7 +644,7 @@ multi sub trait_mod:<is>(Routine $r, Str :$equiv!) {

multi sub trait_mod:<is>(Routine $r, Str :$tighter!) {
if (my $i = nqp::index($r.name, ':')) > 0 {
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~ $tighter ~ '>';
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~ nqp::escape($tighter) ~ '>';
trait_mod:<is>($r, tighter => ::(nm));
return;
}
Expand All @@ -653,7 +653,7 @@ multi sub trait_mod:<is>(Routine $r, Str :$tighter!) {

multi sub trait_mod:<is>(Routine $r, Str :$looser!) {
if (my $i = nqp::index($r.name, ':')) > 0 {
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~ $looser ~ '>';
my \nm ='&' ~ nqp::substr($r.name, 0, $i+1) ~ '<' ~ nqp::escape($looser) ~ '>';
trait_mod:<is>($r, looser => ::(nm));
return;
}
Expand Down

0 comments on commit d8d6abd

Please sign in to comment.