Skip to content

Commit

Permalink
"borrow" rakudos method Match.gist
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Feb 7, 2013
1 parent af64300 commit 5f89e5f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/CORE.setting
Original file line number Diff line number Diff line change
Expand Up @@ -2806,6 +2806,15 @@ my class Match is Cool does Associative does Positional {
"#<match from({ self.from }) to({ self.to }) text({ self }) pos({ @pos.perl }) named({ %(self).perl })>"
}
multi method gist ($d = 0) {
return "#<failed match>" unless self;
my $s = ' ' x ($d + 1);
my $r = ("=> " if $d) ~ "\x[FF62]{self}\x[FF63]\n";
for @.caps {
$r ~= $s ~ (.key // '?') ~ ' ' ~ .value.gist($d + 1)
}
$r;
}
method CURSOR() { Q:CgOp { (cursor_unmatch (cast cursor (@ {self}))) } }
method cursor() { Q:CgOp { (cursor_unmatch (cast cursor (@ {self}))) } }
method reduced() { Q:CgOp { (box Str (cursor_reduced (cast cursor (@ {self})))) } }
Expand Down

0 comments on commit 5f89e5f

Please sign in to comment.