Skip to content

Commit

Permalink
Don't lose namedness of arguments when inlining.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jul 31, 2012
1 parent 0fdbf28 commit 14a8815
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/QAST/InlinePlaceholder.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,21 @@ class QAST::InlinePlaceholder is QAST::Node {
}

method substitute_inline_placeholders(@fillers) {
$!position < +@fillers
?? @fillers[$!position]
!! nqp::die("Inline placeholder index out of range")
if $!position < +@fillers {
my $result := @fillers[$!position];
if self.named || self.flat {
$result := $result.shallow_clone();
if self.named -> $name {
$result.named($name);
}
if self.flat {
$result.flat(1);
}
}
$result
}
else {
nqp::die("Inline placeholder index out of range")
}
}
}

0 comments on commit 14a8815

Please sign in to comment.