Skip to content

Commit 307a186

Browse files
committed
Moves example to right place, refs #2809
1 parent 278a180 commit 307a186

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

doc/Type/Backtrace.pod6

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ if ($!) {
2424
This will print the last dataframe in the list, pointing at the line where it's
2525
happened.
2626
27-
=for code
28-
sub zipi { { { die "Something bad happened" }() }() };
29-
try zipi;
30-
say $!.backtrace.nice( :oneline ) if $! │
31-
# OUTPUT: « in sub zipi at /tmp/Ik2MevkgP1 line 1␤␤»
32-
33-
3427
=head1 Methods
3528
3629
=head2 method new
@@ -73,6 +66,23 @@ the implementation, also some routines from the setting.
7366
my $backtrace = Backtrace.new;
7467
say $backtrace.Str;
7568
69+
=head2 method next-interesting-index
70+
71+
Defined as:
72+
73+
method next-interesting-index(Backtrace:D: Int $idx = 0, :$named, :$noproto, :$setting)
74+
75+
Returns the index of the next C<interesting> frame, once hidden and other
76+
settings are taken into account. C<$named> will decide whether to printed only
77+
those with a name, C<$noproto> will hide C<proto>s, and C<$setting> will hide
78+
those are considered setting.
79+
80+
=for code
81+
sub zipi { { { die "Something bad happened" }() }() };
82+
try zipi;
83+
say $!.backtrace.next-interesting-index; # OUTPUT: «2␤»
84+
say $!.backtrace.next-interesting-index( :named ); # OUTPUT: «4␤»
85+
7686
=head2 method nice
7787
7888
Defined as:
@@ -82,6 +92,13 @@ Defined as:
8292
Returns the backtrace as a list of I<interesting> frames. If C<:$oneline> is
8393
set, will stop after the first frame.
8494
95+
=for code
96+
sub zipi { { { die "Something bad happened" }() }() };
97+
try zipi;
98+
say $!.backtrace.nice( :oneline ) if $! │
99+
# OUTPUT: « in sub zipi at /tmp/Ik2MevkgP1 line 1␤␤»
100+
101+
85102
=head2 method full
86103
87104
Defined as:

0 commit comments

Comments
 (0)