Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use high-level join and fix some op usages.
  • Loading branch information
jnthn committed Feb 27, 2013
1 parent 9819d20 commit a63c38b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions nqp-src/NQPHLL.pm
Expand Up @@ -276,7 +276,7 @@ of the match.
@args.push(', near "');
@args.push(nqp::escape(nqp::substr($target, $pos, 10)));
@args.push('"');
nqp::die(nqp::join('', @args))
nqp::die(join('', @args))
}

method FAILGOAL($goal, $dba?) {
Expand Down Expand Up @@ -1096,7 +1096,7 @@ class HLL::Compiler does HLL::Backend::Default {
}

method panic(*@args) {
nqp::die(nqp::join('', @args))
nqp::die(join('', @args))
}

method stages(@value?) {
Expand Down Expand Up @@ -1249,23 +1249,23 @@ class HLL::Compiler does HLL::Backend::Default {
my $target := nqp::lc(%adverbs<target>);
my $encoding := %adverbs<encoding>;
my @files := nqp::islist($files) ?? $files !! [$files];
$!user_progname := nqp::join(',', @files);
$!user_progname := join(',', @files);
my @codes;
for @files {
my $err := 0;
try {
my $in-handle := nqp::open($_, 'r');
nqp::setencoding($in-handle, $encoding);
nqp::push_s(@codes, nqp::readallfh($in-handle));
nqp::push(@codes, nqp::readallfh($in-handle));
nqp::closefh($in-handle);
CATCH {
$err := "Error while reading from file: $_";
}
}
nqp::die($err) if $err;
}
my $code := nqp::join('', @codes);
my $?FILES := nqp::join(' ', @files);
my $code := join('', @codes);
my $?FILES := join(' ', @files);
my $r := self.eval($code, |@args, |%adverbs);
if $target eq '' || $!backend.is_textual_stage($target) || %adverbs<output> {
return $r;
Expand Down Expand Up @@ -1421,22 +1421,22 @@ class HLL::Compiler does HLL::Backend::Default {
$position := 'after';
} else {
my @new-stages := nqp::clone(self.stages);
nqp::push_s(@new-stages, $stagename);
nqp::push(@new-stages, $stagename);
self.stages(@new-stages);
return 1;
}
my @new-stages := nqp::list_s();
for self.stages {
if $_ eq $where {
if $position eq 'before' {
nqp::push_s(@new-stages, $stagename);
nqp::push_s(@new-stages, $_);
nqp::push(@new-stages, $stagename);
nqp::push(@new-stages, $_);
} else {
nqp::push_s(@new-stages, $_);
nqp::push_s(@new-stages, $stagename);
nqp::push(@new-stages, $_);
nqp::push(@new-stages, $stagename);
}
} else {
nqp::push_s(@new-stages, $_)
nqp::push(@new-stages, $_)
}
}
self.stages(@new-stages);
Expand All @@ -1457,7 +1457,7 @@ class HLL::Compiler does HLL::Backend::Default {
# maybe replace with a grep() once we have the setting for sure
my @actual_ns;
for @ns {
nqp::push_s(@actual_ns, $_) unless $_ eq '';
nqp::push(@actual_ns, $_) unless $_ eq '';
}
@actual_ns;
}
Expand Down
2 changes: 1 addition & 1 deletion nqp-src/QASTNodes.nqp
Expand Up @@ -131,7 +131,7 @@ class QAST::Node {
}
nqp::push(@chunks, "\n");
self.dump_children($indent + 2, @chunks);
return nqp::join('', @chunks);
return join('', @chunks);
}

method dump_children(int $indent, @onto) {
Expand Down
2 changes: 1 addition & 1 deletion nqp-src/QRegex.nqp
Expand Up @@ -1120,7 +1120,7 @@ class NQPMatch is NQPCapture {
!! dump_match($_.key, $_.value);
}
}
return nqp::join('', @chunks);
return join('', @chunks);
}
else {
return nqp::x(' ', $indent) ~ "- NO MATCH\n";
Expand Down

0 comments on commit a63c38b

Please sign in to comment.