Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix and improve merge_twines
  • Loading branch information
Tadeusz Sośnierz committed Aug 15, 2011
1 parent 5f145c6 commit 7810da2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Perl6/Actions.pm
Expand Up @@ -331,14 +331,13 @@ class Perl6::Actions is HLL::Actions {
}

method merge_twines(@twines) {
my @ret := [];
@ret.push($*ST.add_constant('Str', 'str', '')<compile_time_value>);
my @ret := @twines.shift.ast;
for @twines {
my @cur := $_.ast;
@ret.push(
$*ST.add_constant(
'Str', 'str',
nqp::unbox_s(@ret.pop) ~ nqp::unbox_s(@cur.shift)
nqp::unbox_s(@ret.pop) ~ ' ' ~ nqp::unbox_s(@cur.shift)
)<compile_time_value>,
);
nqp::splice(@ret, @cur, +@ret, 0);
Expand Down

0 comments on commit 7810da2

Please sign in to comment.