Skip to content
Permalink
Browse files

Make Capture.WHICH return a ValueObjAt

  • Loading branch information...
lizmat committed Dec 28, 2018
1 parent e50f4f2 commit 6b401dad722f8970e2ece6c2f0c48ee271b059c6
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/core/Capture.pm6
@@ -15,8 +15,10 @@ my class Capture { # declared in BOOTSTRAP
if nqp::attrinited(nqp::decont(%hash),Map,'$!storage')
}

multi method WHICH (Capture:D:) {
my $WHICH = nqp::istype(self.WHAT,Capture) ?? 'Capture' !! self.^name;
multi method WHICH (Capture:D: --> ValueObjAt:D) {
my str $WHICH = nqp::istype(self.WHAT,Capture)
?? 'Capture'
!! self.^name;
if !nqp::isnull(@!list) && @!list {
$WHICH ~= '|';
for nqp::hllize(@!list) -> \elem {
@@ -28,7 +30,7 @@ my class Capture { # declared in BOOTSTRAP
$WHICH ~= ( $_ ~ '(' ~ nqp::atkey(%!hash, nqp::unbox_s($_)).WHICH ~ ')' )
for nqp::hllize(%!hash).keys.sort;
}
$WHICH;
nqp::box_s($WHICH,ValueObjAt)
}

multi method AT-KEY(Capture:D: Str:D \key) is raw {

0 comments on commit 6b401da

Please sign in to comment.
You can’t perform that action at this time.