Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Compile named args in regex subrule arglists.
  • Loading branch information
jnthn committed Oct 6, 2015
1 parent caf4c0f commit eaa6350
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/vm/moar/QAST/QASTRegexCompilerMAST.nqp
Expand Up @@ -1052,16 +1052,18 @@ class QAST::MASTRegexCompiler {
for @($node) {
my $mast := $!qastcomp.as_mast($_);
merge_ins(@masts, $mast.instructions);
nqp::push(@results, $mast.result_reg);
my $kind := $mast.result_kind;
nqp::push(@result_kinds, $kind);
my $flag := @kind_to_args[$kind];
if $_.flat {
$flag := $flag +| ($_.named ?? $Arg::flatnamed !! $Arg::flat);
}
elsif $_.named {
nqp::die('Named args in regex subrule calls NYI');
nqp::push(@results, MAST::SVal.new( value => $_.named ));
nqp::push(@result_kinds, NQPMu);
$flag := $flag +| $Arg::named;
}
nqp::push(@results, $mast.result_reg);
nqp::push(@result_kinds, $kind);
nqp::push(@flags, $flag);
}
[@masts, @results, @result_kinds, @flags]
Expand All @@ -1084,7 +1086,9 @@ class QAST::MASTRegexCompiler {

my $i := 0;
for @kinds {
$!regalloc.release_register(@args[$i++], $_);
$!regalloc.release_register(@args[$i], $_)
if nqp::isconcrete($_);
$i++;
}

@flags[0] := $Arg::obj;
Expand Down

0 comments on commit eaa6350

Please sign in to comment.