Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Another thinko corrected.
As PerlJam++ noted, circumfix:<< >> declarations don't have commas.
  • Loading branch information
peschwa committed Oct 8, 2015
1 parent adca54e commit da99978
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions src/Perl6/World.nqp
Expand Up @@ -2471,40 +2471,12 @@ class Perl6::World is HLL::World {
# if we have something here, it's probably a Slip,
# which stringifies fine but has to be split at ','
# and potentially whitespace-corrected
my @parts := nqp::split(',', ~$result);
my @parts := nqp::split(' ', ~$result);
if +@parts > 2 {
# there's no foofix that allows more than two parts
$/.CURSOR.panic($mkerr());
}
my $l-delim;
my $r-delim;
my @delims;
for @parts -> $part {
my $l-ws := 0;
my $r-ws := nqp::chars($part);
my $l-done := 0;
my $r-done := 0;
while 1 {
last if $l-done && $r-done;
if nqp::eqat($part, ' ', $l-ws) {
$l-ws := $l-ws + 1;
}
else {
$l-done := 1;
}
if nqp::eqat($part, ' ', $r-ws) {
$r-ws := $r-ws - 1;
}
else {
$r-done := 1;
}
}
$part := nqp::substr($part, $l-ws, $r-ws);
nqp::push(@delims, $part);
$/.CURSOR.panic($mkerr()) if nqp::index($part, ' ') != -1;
}
nqp::say("got: " ~ nqp::join(" ", @delims) ~ ".");
return nqp::join(" ", @delims);
return nqp::join(" ", @parts);
CONTROL {
# we might get a warning from evaluating a Block
$/.CURSOR.panic($mkerr());
Expand Down

0 comments on commit da99978

Please sign in to comment.