Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix to support things like is equiv('>+<')
No brainer escape that test to trigger the problem
run into a LTM parsing problem.
  • Loading branch information
cognominal committed Oct 17, 2015
1 parent b670517 commit fe31c4b
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 fe31c4b

Please sign in to comment.