Skip to content

Instantly share code, notes, and snippets.

@FROGGS
Last active December 12, 2015 05:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save FROGGS/0a6f8e2d4053fb0ba5d0 to your computer and use it in GitHub Desktop.
print matches like rakudo
diff --git a/lib/CORE.setting b/lib/CORE.setting
index ffecaae..4186f5e 100644
--- a/lib/CORE.setting
+++ b/lib/CORE.setting
@@ -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})))) } }
@FROGGS
Copy link
Author

FROGGS commented Feb 6, 2013

Test Summary Report

t/spec/S03-junctions/boolean-context.t (Wstat: 0 Tests: 73 Failed: 2)
Failed tests: 49, 51
t/spec/S05-capture/match-object.t (Wstat: 0 Tests: 1 Failed: 0)
Parse errors: Bad plan. You planned 21 tests but ran 1.
t/spec/S05-substitution/subst.t (Wstat: 0 Tests: 0 Failed: 0)
Parse errors: No plan found in TAP output
t/spec/S32-list/roll.t (Wstat: 0 Tests: 40 Failed: 0)
TODO passed: 40
t/spec/S32-str/sprintf.t (Wstat: 0 Tests: 125 Failed: 50)
Failed tests: 63-112
Files=583, Tests=23081, 681 wallclock secs ( 8.52 usr 0.97 sys + 2095.92 cusr 63.04 csys = 2168.45 CPU)
Result: FAIL

will dig into this this evening...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment