lib/Skilletor/Frontmatter.pm

filter: Statementstmt 100% 322 / 322 Branchbran 97.1% 202 / 208 Conditioncond 89.8% 80 / 89 MC/DCmcdc 83.3% 45 / 54 Subroutinesub 100% 35 / 35 Podpod 100% 3 / 3 totaltotal 96.6% 687 / 711 CC 136 SCAR 24.5
CC
136
Cov
98%
block_scalar
23.0
_unescape_double
21.0
value
14.0
CRAP 11.6
« /usr/local/lib/perl5/site_perl/5.44.0/namespace/clean.pm ↑ Summary lib/Skilletor/Convert.pm »
1 package Skilletor::Frontmatter;
2 # ABSTRACT: The reference's YAML subset – agent frontmatter and bundle files
3  
4 469 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 469 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 469 ▶use Exporter qw( import );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 469 ▶use JSON::MaybeXS ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 469 ▶use Scalar::Util qw( blessed );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 469 ▶use Skilletor::Error;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 469 ▶use Skilletor::Error::Frontmatter;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 469 ▶use Skilletor::JSON qw( js_ordered );
Subroutine BEGIN: called CC=1 SCAR=0.0
13 469 ▶use Skilletor::JSString qw( js_trim js_ws_re );
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 469 our $VERSION = '0.008000';
16  
17 469 our @EXPORT_OK = qw( split_frontmatter parse_yaml_document is_yaml_float );
18  
19 # JavaScript's `.` (no line terminator) and `\s`.
20 469 my $DOT = qr/[^\n\r\x{2028}\x{2029}]/;
21 469 my $WS = js_ws_re();
22 469 my $LT = qr/[\n\r\x{2028}\x{2029}]/;
23  
24 469 my $OPEN = qr/\A---[ \t]*\r?\n/;
25 # /^---[ \t]*(?:\r?\n|$)/m: JavaScript's multiline ^ and $ sit at any line terminator.
26 469 my $CLOSE = qr/(?:\A|(?<=$LT))---[ \t]*(?:\r?\n|(?=$LT)|\z)/;
27  
28 # "key": / 'key': / plain key, then `:` followed by whitespace or the end.
29 469 my $KEY_RE = qr/\A(?:"((?:[^"\\]|\\$DOT)*)"|'((?:[^']|'')*)'|((?!$WS)[^"'#&*!|>\[\]{},?:\-][^:#]*?))[ \t]*:(?:[ \t]+($DOT*))?\z/;
30  
31 469 my %ESCAPES = (
32 '0' => "\0", a => "\x07", b => "\b", t => "\t", "\t" => "\t", n => "\n", v => "\x0B", f => "\f", r => "\r",
33 e => "\x1b", ' ' => ' ', '"' => '"', '/' => '/', '\\' => '\\', N => "\x{85}", _ => "\x{A0}", L => "\x{2028}",
34 P => "\x{2029}",
35 );
36  
37 1888 ▶sub split_frontmatter {
Subroutine split_frontmatter: called CC=3 SCAR=11.0
Pod documented
38 1888 my ( $text ) = @_;
39 1888 ▶ return { data => js_ordered(), body => $text } unless $text =~ $OPEN;
Branch: 1 branch
BranchTrueFalseTotal
unless $text =~ /$OPEN/ 1203 685 1888
40 685 my $start = $+[0];
41 685 pos($text) = $start;
42 685 ▶ Skilletor::Error::Frontmatter->throw('frontmatter: no closing --- line') unless $text =~ /$CLOSE/g;
Branch: 1 branch
BranchTrueFalseTotal
unless $text =~ /$CLOSE/g 3 682 685
43 682 my ( $close, $after ) = ( $-[0], $+[0] );
44 682 my $yaml = substr $text, $start, $close - $start;
45 682 ( my $body = substr $text, $after ) =~ s/\A(?:[ \t]*\r?\n)+//;
46 682 return { data => _parse_yaml( $yaml, 2, 'frontmatter line' ), body => $body };
47 }
48  
49 1064 ▶sub parse_yaml_document {
Subroutine parse_yaml_document: called CC=1 SCAR=0.0
Pod documented
50 1064 my ( $text ) = @_;
51 1064 return _parse_yaml( $text, 1, 'line' );
52 }
53  
54 3030 ▶sub is_yaml_float { blessed $_[0] && $_[0]->isa('Skilletor::Frontmatter::Float') ? 1 : 0 }
Subroutine is_yaml_float: called CC=3 SCAR=11.0
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_[0]) && $_[0]->isa('Skilletor::Frontmatter::Float') ? : 94 2936 3030
Condition100%3/3
builtin::blessed($_[0]) and $_[0]->isa("Skilletor::Frontmatter::Float")
!ll&&!rl&&r
29102694
MC/DC100%2/2
builtin::blessed($_[0]) and $_[0]->isa("Skilletor::Frontmatter::Float")
builtin::blessed($_[0]) $_[0]->isa("Skilletor::Frontmatter::Float")
Truth table100%3/3
A and B
A= builtin::blessed($_[0])B= $_[0]->isa("Skilletor::Frontmatter::Float")
ABresult
0X0
100
111
55  
56 #### The parser ########################################################
57  
58 338 ▶sub _fail {
Subroutine _fail: called CC=3 SCAR=12.0
59 338 my ( $line, $message ) = @_;
60 338 ▶ Skilletor::Error::Frontmatter->throw( ( $line ? $line->{label} : 'line' ).' '.( $line ? $line->{no} : '?' ).': '.$message );
Branch: 2 branches
BranchTrueFalseTotal
$line ? : 338 0 338
$line ? : 338 0 338
61 }
62  
63 4665 ▶sub _indent_of {
Subroutine _indent_of: called CC=2 SCAR=6.9
64 4665 my ( $line ) = @_;
65 4665 my ($m) = $line->{raw} =~ /\A([ \t]*)/;
66 4665 ▶ _fail( $line, 'tabs are not allowed in indentation' ) if index( $m, "\t" ) >= 0;
Branch: 1 branch
BranchTrueFalseTotal
if index($m, "\t") != -1 3 4662 4665
67 4662 return length $m;
68 }
69  
70 7238 ▶sub _skippable {
Subroutine _skippable: called CC=3 SCAR=11.0
71 7238 my ( $line ) = @_;
72 7238 my $t = js_trim( $line->{raw} );
73 7238 ▶ return ( $t eq '' || substr( $t, 0, 1 ) eq '#' ) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$t eq '' || substr($t, 0, 1) eq '#' ? : 2640 4598 7238
Condition100%3/3
$t eq "" or substr($t, 0, 1) eq "#"
l!l&&r!l&&!r
263644598
MC/DC100%2/2
$t eq "" or substr($t, 0, 1) eq "#"
$t eq "" substr($t, 0, 1) eq "#"
Truth table100%3/3
A or B
A= $t eq ""B= substr($t, 0, 1) eq "#"
ABresult
1X1
011
000
74 }
75  
76 3304 ▶sub _is_seq_item {
Subroutine _is_seq_item: called CC=3 SCAR=11.0
77 3304 my ( $text ) = @_;
78 3304 ▶ return ( $text eq '-' || substr( $text, 0, 2 ) eq '- ' ) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$text eq '-' || substr($text, 0, 2) eq '- ' ? : 130 3174 3304
Condition100%3/3
$text eq "-" or substr($text, 0, 2) eq "- "
l!l&&r!l&&!r
21283174
MC/DC100%2/2
$text eq "-" or substr($text, 0, 2) eq "- "
$text eq "-" substr($text, 0, 2) eq "- "
Truth table100%3/3
A or B
A= $text eq "-"B= substr($text, 0, 2) eq "- "
ABresult
1X1
011
000
79 }
80  
81 1746 ▶sub _parse_yaml {
Subroutine _parse_yaml: called CC=2 SCAR=7.0
82 1746 my ( $yaml, $first_line, $label ) = @_;
83 1746 my $i = 0;
84 1746 my @lines = map { +{ no => $i++ + $first_line, raw => $_, label => $label } } split /\r?\n/, $yaml, -1;
85 1746 my $p = bless { lines => \@lines }, 'Skilletor::Frontmatter::_Parser';
86 1746 my ( $value, $pos ) = $p->mapping( 0, 0 );
87 1408 ▶ _fail( $lines[$pos], 'unexpected content' ) if $pos < @lines;
Branch: 1 branch
BranchTrueFalseTotal
if $pos < @lines 0 1408 1408
88 1408 return $value;
89 }
90  
91 package # hide from PAUSE
92 Skilletor::Frontmatter::_Parser;
93  
94 7535 ▶sub next_content {
Subroutine next_content: called CC=3 SCAR=11.0
95 7535 my ( $self, $pos ) = @_;
96 7535 my $lines = $self->{lines};
97 7535 ▶ $pos++ while $pos < @$lines && Skilletor::Frontmatter::_skippable( $lines->[$pos] );
Branch: 1 branch
BranchTrueFalseTotal
$pos < @$lines and Skilletor::Frontmatter::_skippable($lines->[$pos]) and do { ++$pos } 2640 7535 10175
Condition100%3/3
$pos < @$lines and Skilletor::Frontmatter::_skippable($lines->[$pos])
!ll&&!rl&&r
293745982640
MC/DC100%2/2
$pos < @$lines and Skilletor::Frontmatter::_skippable($lines->[$pos])
$pos < @$lines Skilletor::Frontmatter::_skippable($lines->[$pos])
Truth table100%3/3
A and B
A= $pos < @$linesB= Skilletor::Frontmatter::_skippable($lines->[$pos])
ABresult
0X0
100
111
98 7535 return $pos;
99 }
100  
101 1873 ▶sub mapping {
Subroutine mapping: called CC=10 SCAR=23.0
102 1873 my ( $self, $start, $indent ) = @_;
103 1873 my $lines = $self->{lines};
104 1873 my $obj = Skilletor::JSON::js_ordered();
105 1873 my $pos = $start;
106 1873 for ( ;; ) {
107 4624 $pos = $self->next_content($pos);
108 4624 ▶ last if $pos >= @$lines;
Branch: 1 branch
BranchTrueFalseTotal
if $pos >= @$lines 1512 3112 4624
109 3112 my $line = $lines->[$pos];
110 3112 my $ind = Skilletor::Frontmatter::_indent_of($line);
111 3112 ▶ last if $ind < $indent;
Branch: 1 branch
BranchTrueFalseTotal
if $ind < $indent 23 3089 3112
112 3089 ▶ Skilletor::Frontmatter::_fail( $line, 'unexpected indentation' ) if $ind > $indent;
Branch: 1 branch
BranchTrueFalseTotal
if $ind > $indent 40 3049 3089
113 3049 my $text = substr $line->{raw}, $ind;
114 3049 ▶ Skilletor::Frontmatter::_fail( $line, 'unexpected sequence item' ) if Skilletor::Frontmatter::_is_seq_item($text);
Branch: 1 branch
BranchTrueFalseTotal
if Skilletor::Frontmatter::_is_seq_item($text) 7 3042 3049
115 3042 ▶ my @m = $text =~ $KEY_RE or Skilletor::Frontmatter::_fail( $line, 'expected `key: value`' );
Branch: 1 branch
BranchTrueFalseTotal
my(@m) = $text =~ /$KEY_RE/ or Skilletor::Frontmatter::_fail($line, "expected `key: value`") 2813 229 3042
116 2813 ▶ my $key = defined $m[0] ? Skilletor::Frontmatter::_unescape_double( $m[0], $line )
Branch: 2 branches
BranchTrueFalseTotal
defined $m[0] ? : 14 2799 2813
defined $m[1] ? : 4 2795 2799
117 : defined $m[1] ? $m[1] =~ s/''/'/gr
118 : Skilletor::JSString::js_trim( $m[2] );
119 2813 ▶ Skilletor::Frontmatter::_fail( $line, 'duplicate key "'.$key.'"' ) if exists $obj->{$key};
Branch: 1 branch
BranchTrueFalseTotal
if exists $obj->{$key} 3 2810 2813
120 2810 ▶ my ( $value, $next ) = $self->value( $m[3] // '', $pos + 1, $indent, $line );
Condition100%2/2
$m[3] // ""
l!l
2618192
MC/DC100%1/1
$m[3] // ""
$m[3]
Truth table100%2/2
A
A= $m[3]
Aresult
11
00
121 2751 $obj->{$key} = $value;
122 2751 $pos = $next;
123 }
124 1535 return ( $obj, $pos );
125 }
126  
127 # The value after `key:` on $line; $pos is the line after it.
128 2810 ▶sub value {
Subroutine value: called CC=14 SCAR=26.4
129 2810 my ( $self, $rest, $pos, $indent, $line ) = @_;
130 2810 my $lines = $self->{lines};
131 2810 my $r = Skilletor::JSString::js_trim($rest);
132 2810 ▶ return $self->block_scalar( $r, $pos, $indent, $line ) if $r =~ /\A[|>]/;
Branch: 1 branch
BranchTrueFalseTotal
if $r =~ /\A[|>]/ 36 2774 2810
133 2774 ▶ if ( $r eq '' || substr( $r, 0, 1 ) eq '#' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($r eq "" or substr($r, 0, 1) eq "#") 195 2579 2774
Condition100%3/3
$r eq "" or substr($r, 0, 1) eq "#"
l!l&&r!l&&!r
19322579
MC/DC100%2/2
$r eq "" or substr($r, 0, 1) eq "#"
$r eq "" substr($r, 0, 1) eq "#"
Truth table100%3/3
A or B
A= $r eq ""B= substr($r, 0, 1) eq "#"
ABresult
1X1
011
000
134 195 my $q = $self->next_content($pos);
135 195 ▶ return ( undef, $q ) if $q >= @$lines;
Branch: 1 branch
BranchTrueFalseTotal
if $q >= @$lines 19 176 195
136 176 my $next = $lines->[$q];
137 176 my $ind = Skilletor::Frontmatter::_indent_of($next);
138 174 my $text = substr $next->{raw}, $ind;
139 174 ▶ if ( $ind > $indent ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ind > $indent) 169 5 174
140 169 ▶ return Skilletor::Frontmatter::_is_seq_item($text) ? $self->sequence( $q, $ind ) : $self->mapping( $q, $ind );
Branch: 1 branch
BranchTrueFalseTotal
Skilletor::Frontmatter::_is_seq_item($text) ? : 42 127 169
141 }
142 5 ▶ return $self->sequence( $q, $ind ) if $ind == $indent && Skilletor::Frontmatter::_is_seq_item($text);
Branch: 1 branch
BranchTrueFalseTotal
if $ind == $indent and Skilletor::Frontmatter::_is_seq_item($text) 2 3 5
Condition66%2/3
$ind == $indent and Skilletor::Frontmatter::_is_seq_item($text)
!ll&&!rl&&r
032
MC/DC50%1/2
$ind == $indent and Skilletor::Frontmatter::_is_seq_item($text)
$ind == $indent Skilletor::Frontmatter::_is_seq_item($text)
Truth table66%2/3
A and B
A= $ind == $indentB= Skilletor::Frontmatter::_is_seq_item($text)
ABresult
0X0
100
111
143 3 return ( undef, $q );
144 }
145 # An inline value, possibly continued on more-indented lines (folded with spaces).
146 2579 my @parts = ($r);
147 2579 my $p = $pos;
148 2579 for ( ;; ) {
149 2599 my $q = $self->next_content($p);
150 2599 ▶ last if $q >= @$lines || Skilletor::Frontmatter::_indent_of( $lines->[$q] ) <= $indent;
Branch: 1 branch
BranchTrueFalseTotal
if $q >= @$lines or Skilletor::Frontmatter::_indent_of($lines->[$q]) <= $indent 2578 20 2598
Condition100%3/3
$q >= @$lines or Skilletor::Frontmatter::_indent_of($lines->[$q]) <= $indent
l!l&&r!l&&!r
1379120020
MC/DC100%2/2
$q >= @$lines or Skilletor::Frontmatter::_indent_of($lines->[$q]) <= $indent
$q >= @$lines Skilletor::Frontmatter::_indent_of($lines->[$q]) <= $indent
Truth table100%3/3
A or B
A= $q >= @$linesB= Skilletor::Frontmatter::_indent_of($lines->[$q]) <= $indent
ABresult
1X1
011
000
151 20 push @parts, Skilletor::JSString::js_trim( $lines->[$q]{raw} );
152 20 $p = $q + 1;
153 }
154 2578 ▶ return ( Skilletor::Frontmatter::_inline( $r, $line ), $pos ) if @parts == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @parts == 1 2561 17 2578
155 17 ▶ return ( Skilletor::Frontmatter::_inline( join( ' ', @parts ), $line ), $p ) if $r =~ /\A["'\[{]/;
Branch: 1 branch
BranchTrueFalseTotal
if $r =~ /\A["'\[{]/ 8 9 17
156 9 ▶ Skilletor::Frontmatter::_fail( $line, 'anchors, aliases and tags are not supported' ) if $r =~ /\A[&*!]/;
Branch: 1 branch
BranchTrueFalseTotal
if $r =~ /\A[&*!]/ 0 9 9
157 9 return ( join( ' ', map { Skilletor::Frontmatter::_strip_comment($_) } @parts ), $p );
158 }
159  
160 44 ▶sub sequence {
Subroutine sequence: called CC=9 SCAR=22.0
161 44 my ( $self, $start, $indent ) = @_;
162 44 my $lines = $self->{lines};
163 44 my @arr;
164 44 my $pos = $start;
165 44 for ( ;; ) {
166 117 $pos = $self->next_content($pos);
167 117 ▶ last if $pos >= @$lines;
Branch: 1 branch
BranchTrueFalseTotal
if $pos >= @$lines 27 90 117
168 90 my $line = $lines->[$pos];
169 90 my $ind = Skilletor::Frontmatter::_indent_of($line);
170 90 ▶ last if $ind < $indent;
Branch: 1 branch
BranchTrueFalseTotal
if $ind < $indent 7 83 90
171 83 ▶ Skilletor::Frontmatter::_fail( $line, 'unexpected indentation in a sequence' ) if $ind > $indent;
Branch: 1 branch
BranchTrueFalseTotal
if $ind > $indent 2 81 83
172 81 my $text = substr $line->{raw}, $ind;
173 81 ▶ last unless Skilletor::Frontmatter::_is_seq_item($text);
Branch: 1 branch
BranchTrueFalseTotal
unless Skilletor::Frontmatter::_is_seq_item($text) 2 79 81
174 79 my $item = Skilletor::JSString::js_trim( substr $text, 1 );
175 79 ▶ if ( $item eq '' || substr( $item, 0, 1 ) eq '#' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($item eq "" or substr($item, 0, 1) eq "#") 2 77 79
Condition66%2/3
$item eq "" or substr($item, 0, 1) eq "#"
l!l&&r!l&&!r
2077
MC/DC50%1/2
$item eq "" or substr($item, 0, 1) eq "#"
$item eq "" substr($item, 0, 1) eq "#"
Truth table66%2/3
A or B
A= $item eq ""B= substr($item, 0, 1) eq "#"
ABresult
1X1
011
000
176 2 Skilletor::Frontmatter::_fail( $line, 'nested blocks inside sequences are not supported' );
177 }
178 77 ▶ Skilletor::Frontmatter::_fail( $line, 'mappings inside sequences are not supported' ) if $item =~ $KEY_RE;
Branch: 1 branch
BranchTrueFalseTotal
if $item =~ /$KEY_RE/ 2 75 77
179 75 ▶ Skilletor::Frontmatter::_fail( $line, 'nested collections are not supported' ) if $item =~ /\A[\[{]/;
Branch: 1 branch
BranchTrueFalseTotal
if $item =~ /\A[\[{]/ 2 73 75
180 73 push @arr, Skilletor::Frontmatter::_inline( $item, $line );
181 73 $pos++;
182 }
183 36 return ( \@arr, $pos );
184 }
185  
186 36 ▶sub block_scalar {
Subroutine block_scalar: called CC=23 SCAR=31.4
187 36 my ( $self, $header, $pos, $indent, $line ) = @_;
188 36 my $lines = $self->{lines};
189 36 ▶ my @h = $header =~ /\A([|>])([+-]?)([1-9]?)[ \t]*(?:#$DOT*)?\z/
Branch: 1 branch
BranchTrueFalseTotal
my(@h) = $header =~ /\A([|>])([+-]?)([1-9]?)[ \t]*(?:#$DOT*)?\z/ or Skilletor::Frontmatter::_fail($line, 'unsupported block scalar header "' . $header . '"') 34 2 36
190 or Skilletor::Frontmatter::_fail( $line, 'unsupported block scalar header "'.$header.'"' );
191 34 my $folded = $h[0] eq '>';
192 34 my $chomp = $h[1];
193 34 ▶ my $content_indent = length $h[2] ? $indent + $h[2] : -1;
Branch: 1 branch
BranchTrueFalseTotal
length $h[2] ? : 4 30 34
194 34 my @collected;
195 34 my $p = $pos;
196 34 ▶ while ( $p < @$lines ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($p < @$lines) 100 15 115
197 100 my $l = $lines->[$p];
198 100 ▶ if ( Skilletor::JSString::js_trim( $l->{raw} ) eq '' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (Skilletor::JSString::js_trim($l->{"raw"}) eq "") 33 67 100
199 33 push @collected, $l;
200 33 $p++;
201 33 next;
202 }
203 67 my $ind = Skilletor::Frontmatter::_indent_of($l);
204 67 ▶ last if $ind <= $indent;
Branch: 1 branch
BranchTrueFalseTotal
if $ind <= $indent 17 50 67
205 50 ▶ $content_indent = $ind if $content_indent == -1;
Branch: 1 branch
BranchTrueFalseTotal
if $content_indent == -1 22 28 50
206 50 ▶ Skilletor::Frontmatter::_fail( $l, 'block scalar line is less indented than its first line' ) if $ind < $content_indent;
Branch: 1 branch
BranchTrueFalseTotal
if $ind < $content_indent 2 48 50
207 48 push @collected, $l;
208 48 $p++;
209 }
210 32 ▶ my @texts = map { Skilletor::JSString::js_trim( $_->{raw} ) eq '' ? '' : substr( $_->{raw}, $content_indent ) } @collected;
Branch: 1 branch
BranchTrueFalseTotal
Skilletor::JSString::js_trim($_->{'raw'}) eq '' ? : 33 46 79
211 32 my $trailing = 0;
212 32 ▶ while ( @texts && $texts[-1] eq '' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@texts and $texts[-1] eq "") 28 32 60
Condition100%3/3
@texts and $texts[-1] eq ""
!ll&&!rl&&r
82428
MC/DC100%2/2
@texts and $texts[-1] eq ""
@texts $texts[-1] eq ""
Truth table100%3/3
A and B
A= @textsB= $texts[-1] eq ""
ABresult
0X0
100
111
213 28 pop @texts;
214 28 $trailing++;
215 }
216 32 my $body;
217 32 ▶ if ( !$folded ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $folded) { } 25 7 32
218 25 $body = join "\n", @texts;
219 }
220 else {
221 7 $body = '';
222 7 my ( $pending, $first, $prev_more ) = ( 0, 1, 0 );
223 7 for my $t (@texts) {
224 20 ▶ if ( $t eq '' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($t eq "") 3 17 20
225 3 $pending++;
226 3 next;
227 }
228 17 ▶ my $more = $t =~ /\A[ \t]/ ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$t =~ /\A[ \t]/ ? : 2 15 17
229 17 ▶ if ($first) { $body = $t }
Branch: 3 branches
BranchTrueFalseTotal
if ($first) { } 5 12 17
elsif ($pending > 0) { } 3 9 12
elsif ($more or $prev_more) { } 4 5 9
230 3 elsif ( $pending > 0 ) { $body .= ( "\n" x $pending ).$t }
231 4 ▶ elsif ( $more || $prev_more ) { $body .= "\n".$t }
Condition100%3/3
$more or $prev_more
l!l&&r!l&&!r
225
MC/DC100%2/2
$more or $prev_more
$more $prev_more
Truth table100%3/3
A or B
A= $moreB= $prev_more
ABresult
1X1
011
000
232 5 else { $body .= ' '.$t }
233 17 $first = 0;
234 17 $pending = 0;
235 17 $prev_more = $more;
236 }
237 }
238 32 ▶ return ( $body, $p ) if $chomp eq '-';
Branch: 1 branch
BranchTrueFalseTotal
if $chomp eq "-" 6 26 32
239 26 ▶ return ( '', $p ) if $body eq '' && $chomp ne '+';
Branch: 1 branch
BranchTrueFalseTotal
if $body eq "" and $chomp ne "+" 4 22 26
Condition100%3/3
$body eq "" and $chomp ne "+"
!ll&&!rl&&r
2024
MC/DC100%2/2
$body eq "" and $chomp ne "+"
$body eq "" $chomp ne "+"
Truth table100%3/3
A and B
A= $body eq ""B= $chomp ne "+"
ABresult
0X0
100
111
240 22 ▶ return ( $body."\n".( $chomp eq '+' ? "\n" x $trailing : '' ), $p );
Branch: 1 branch
BranchTrueFalseTotal
$chomp eq '+' ? : 6 16 22
241 }
242  
243 package Skilletor::Frontmatter;
244  
245 #### Inline values #####################################################
246  
247 1710 ▶sub _strip_comment {
Subroutine _strip_comment: called CC=2 SCAR=6.9
248 1710 my ( $s ) = @_;
249 1710 ▶ return js_trim( $s =~ /(?:\A|[ \t])#/ ? substr( $s, 0, $-[0] ) : $s );
Branch: 1 branch
BranchTrueFalseTotal
$s =~ /(?:\A|[ \t])#/ ? : 11 1699 1710
250 }
251  
252 2427 ▶sub _typed_plain {
Subroutine _typed_plain: called CC=11 SCAR=24.0
253 2427 my ( $s ) = @_;
254 2427 ▶ return undef if $s eq '' || $s eq '~' || $s =~ /\A(?:null|Null|NULL)\z/;
Branch: 1 branch
BranchTrueFalseTotal
if $s eq "" or $s eq "~" or $s =~ /\A(?:null|Null|NULL)\z/ 30 2397 2427
Condition83%5/6
$s eq "" or $s eq "~" or $s =~ /\A(?:null|Null|NULL)\z/
l!l&&r!l&&!r
14162397
$s eq "" or $s eq "~"
l!l&&r!l&&!r
0142413
MC/DC66%2/3
$s eq "" or $s eq "~" or $s =~ /\A(?:null|Null|NULL)\z/
$s eq "" $s eq "~" $s =~ /\A(?:null|Null|NULL)\z/
Truth table75%3/4
A or B or C
A= $s eq ""B= $s eq "~"C= $s =~ /\A(?:null|Null|NULL)\z/
ABCresult
1XX1
01X1
0011
0000
255 2397 ▶ return JSON::MaybeXS::true() if $s =~ /\A(?:true|True|TRUE)\z/;
Branch: 1 branch
BranchTrueFalseTotal
if $s =~ /\A(?:true|True|TRUE)\z/ 24 2373 2397
256 2373 ▶ return JSON::MaybeXS::false() if $s =~ /\A(?:false|False|FALSE)\z/;
Branch: 1 branch
BranchTrueFalseTotal
if $s =~ /\A(?:false|False|FALSE)\z/ 7 2366 2373
257 2366 ▶ if ( $s =~ /\A[-+]?([0-9]+)\z/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s =~ /\A[-+]?([0-9]+)\z/) 113 2253 2366
258 113 ( my $digits = $1 ) =~ s/\A0+(?=.)//;
259 # Number.isSafeInteger: |n| <= 2**53 - 1, else the text stays a string.
260 113 ▶ my $safe = length($digits) < 16 || ( length($digits) == 16 && $digits le '9007199254740991' );
Condition100%6/6
length $digits < 16 || length $digits == 16 && $digits le '9007199254740991'
l!l&&r!l&&!r
10247
length $digits == 16 and $digits le "9007199254740991"
!ll&&!rl&&r
164
MC/DC100%3/3
length $digits < 16 || length $digits == 16 && $digits le '9007199254740991'
length $digits < 16 length $digits == 16 $digits le "9007199254740991"
Truth table100%4/4
A || B and C
A= length $digits < 16B= length $digits == 16C= $digits le "9007199254740991"
ABCresult
1XX1
0111
00X0
0100
261 113 ▶ return $safe ? 0 + $s : $s;
Branch: 1 branch
BranchTrueFalseTotal
$safe ? : 106 7 113
262 }
263 2253 ▶ if ( $s =~ /\A[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*|[0-9]+(?=[eE]))(?:[eE][-+]?[0-9]+)?\z/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s =~ /\A[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*|[0-9]+(?=[eE]))(?:[eE][-+]?[0-9]+)?\z/) 53 2200 2253
264 469 ▶ no warnings 'numeric';
Subroutine BEGIN: called CC=1 SCAR=0.0
265 53 return Skilletor::Frontmatter::Float->new( 0 + $s );
266 }
267 2200 return $s;
268 }
269  
270 233 ▶sub _unescape_double {
Subroutine _unescape_double: called CC=21 SCAR=30.5
271 233 my ( $s, $line ) = @_;
272 233 my $out = '';
273 233 my $n = length $s;
274 233 ▶ for ( my $i = 0; $i < $n; $i++ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $n) 4593 225 4818
275 4593 my $ch = substr $s, $i, 1;
276 4593 ▶ if ( $ch ne '\\' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ch ne "\\") 4486 107 4593
277 4486 $out .= $ch;
278 4486 next;
279 }
280 107 $i++;
281 107 ▶ _fail( $line, 'dangling backslash in a double-quoted string' ) if $i >= $n;
Branch: 1 branch
BranchTrueFalseTotal
if $i >= $n 0 107 107
282 107 my $e = substr $s, $i, 1;
283 107 ▶ my $hex_len = $e eq 'x' ? 2 : $e eq 'u' ? 4 : $e eq 'U' ? 8 : 0;
Branch: 3 branches
BranchTrueFalseTotal
$e eq 'x' ? : 9 98 107
$e eq 'u' ? : 41 57 98
$e eq 'U' ? : 11 46 57
284 107 ▶ if ($hex_len) {
Branch: 2 branches
BranchTrueFalseTotal
if ($hex_len) { } 61 46 107
elsif (exists $ESCAPES{$e}) { } 43 3 46
285 61 my $hex = substr $s, $i + 1, $hex_len;
286 61 ▶ _fail( $line, 'bad \\'.$e.' escape' ) unless $hex =~ /\A[0-9a-fA-F]{$hex_len}\z/;
Branch: 1 branch
BranchTrueFalseTotal
unless $hex =~ /\A[0-9a-fA-F]{$hex_len}\z/ 2 59 61
287 59 my $cp = hex $hex;
288 # Above U+10FFFF the reference refuses the escape like any other bad one.
289 59 ▶ _fail( $line, 'bad \\'.$e.' escape' ) if $cp > 0x10FFFF;
Branch: 1 branch
BranchTrueFalseTotal
if $cp > 1114111 3 56 59
290 # JavaScript strings are UTF-16: adjoining escapes that make a high and low half are one
291 # scalar when Node later encodes the string. Keep that character joined in Perl too.
292 56 my $next = $i + $hex_len + 1;
293 56 ▶ my $next_e = $next < $n ? substr( $s, $next + 1, 1 ) : '';
Branch: 1 branch
BranchTrueFalseTotal
$next < $n ? : 34 22 56
294 56 ▶ my $next_len = $next_e eq 'u' ? 4 : $next_e eq 'U' ? 8 : 0;
Branch: 2 branches
BranchTrueFalseTotal
$next_e eq 'u' ? : 14 42 56
$next_e eq 'U' ? : 6 36 42
295 56 ▶ my $next_hex = $next_len ? substr( $s, $next + 2, $next_len ) : '';
Branch: 1 branch
BranchTrueFalseTotal
$next_len ? : 20 36 56
296 56 ▶ if ( $cp >= 0xD800 && $cp <= 0xDBFF && substr( $s, $next, 1 ) eq '\\'
Branch: 1 branch
BranchTrueFalseTotal
if ($cp >= 55296 and $cp <= 56319 and substr($s, $next, 1) eq "\\" and $next_hex =~ /\A[0-9a-fA-F]{$next_len}\z/) 13 43 56
Condition88%8/9
$cp >= 55296 and $cp <= 56319 and substr($s, $next, 1) eq "\\" and $next_hex =~ /\A[0-9a-fA-F]{$next_len}\z/
!ll&&!rl&&r
43013
$cp >= 55296 and $cp <= 56319 and substr($s, $next, 1) eq "\\"
!ll&&!rl&&r
37613
$cp >= 55296 and $cp <= 56319
!ll&&!rl&&r
241319
MC/DC75%3/4
$cp >= 55296 and $cp <= 56319 and substr($s, $next, 1) eq "\\" and $next_hex =~ /\A[0-9a-fA-F]{$next_len}\z/
$cp >= 55296 $cp <= 56319 substr($s, $next, 1) eq "\\" $next_hex =~ /\A[0-9a-fA-F]{$next_len}\z/
Truth table80%4/5
A and B and C and D
A= $cp >= 55296B= $cp <= 56319C= substr($s, $next, 1) eq "\\"D= $next_hex =~ /\A[0-9a-fA-F]{$next_len}\z/
ABCDresult
0XXX0
10XX0
110X0
11100
11111
297 && $next_hex =~ /\A[0-9a-fA-F]{$next_len}\z/ ) {
298 13 my $low = hex $next_hex;
299 13 ▶ if ( $low >= 0xDC00 && $low <= 0xDFFF ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($low >= 56320 and $low <= 57343) 11 2 13
Condition66%2/3
$low >= 56320 and $low <= 57343
!ll&&!rl&&r
2011
MC/DC50%1/2
$low >= 56320 and $low <= 57343
$low >= 56320 $low <= 57343
Truth table66%2/3
A and B
A= $low >= 56320B= $low <= 57343
ABresult
0X0
100
111
300 11 $out .= chr( 0x10000 + ( ( $cp - 0xD800 ) << 10 ) + ( $low - 0xDC00 ) );
301 11 $i = $next + 1 + $next_len;
302 11 next;
303 }
304 }
305 469 ▶ no warnings qw( surrogate nonchar non_unicode );
Subroutine BEGIN: called CC=1 SCAR=0.0
306 45 $out .= chr $cp;
307 45 $i += $hex_len;
308 }
309 elsif ( exists $ESCAPES{$e} ) {
310 43 $out .= $ESCAPES{$e};
311 }
312 else {
313 3 _fail( $line, 'unknown escape \\'.$e );
314 }
315 }
316 225 return $out;
317 }
318  
319 # One quoted scalar at substr($s, $i, 1) (a quote): the value and the index after it.
320 265 ▶sub _quoted {
Subroutine _quoted: called CC=9 SCAR=22.0
321 265 my ( $s, $i, $line ) = @_;
322 265 my $q = substr $s, $i, 1;
323 265 my $n = length $s;
324 265 my $j = $i + 1;
325 265 ▶ if ( $q eq "'" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($q eq "'") 42 223 265
326 42 my $out = '';
327 42 for ( ;; ) {
328 241 ▶ _fail( $line, 'unterminated single-quoted string' ) if $j >= $n;
Branch: 1 branch
BranchTrueFalseTotal
if $j >= $n 0 241 241
329 241 ▶ if ( substr( $s, $j, 1 ) eq "'" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (substr($s, $j, 1) eq "'") 48 193 241
330 48 ▶ if ( $j + 1 < $n && substr( $s, $j + 1, 1 ) eq "'" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($j + 1 < $n and substr($s, $j + 1, 1) eq "'") 6 42 48
Condition100%3/3
$j + 1 < $n and substr($s, $j + 1, 1) eq "'"
!ll&&!rl&&r
3396
MC/DC100%2/2
$j + 1 < $n and substr($s, $j + 1, 1) eq "'"
$j + 1 < $n substr($s, $j + 1, 1) eq "'"
Truth table100%3/3
A and B
A= $j + 1 < $nB= substr($s, $j + 1, 1) eq "'"
ABresult
0X0
100
111
331 6 $out .= "'";
332 6 $j += 2;
333 6 next;
334 }
335 42 return ( $out, $j + 1 );
336 }
337 193 $out .= substr $s, $j++, 1;
338 }
339 }
340 223 for ( ;; ) {
341 5137 ▶ _fail( $line, 'unterminated double-quoted string' ) if $j >= $n;
Branch: 1 branch
BranchTrueFalseTotal
if $j >= $n 4 5133 5137
342 5133 my $c = substr $s, $j, 1;
343 5133 ▶ if ( $c eq '\\' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($c eq "\\") 117 5016 5133
344 117 $j += 2;
345 117 next;
346 }
347 5016 ▶ return ( _unescape_double( substr( $s, $i + 1, $j - $i - 1 ), $line ), $j + 1 ) if $c eq '"';
Branch: 1 branch
BranchTrueFalseTotal
if $c eq "\"" 219 4797 5016
348 4797 $j++;
349 }
350 }
351  
352 913 ▶sub _assert_end {
Subroutine _assert_end: called CC=4 SCAR=13.9
353 913 my ( $s, $i, $line ) = @_;
354 913 ▶ my $rest = js_trim( $i < length $s ? substr( $s, $i ) : '' );
Branch: 1 branch
BranchTrueFalseTotal
$i < length $s ? : 8 905 913
355 913 ▶ _fail( $line, 'unexpected text after a value: "'.$rest.'"' ) if $rest ne '' && substr( $rest, 0, 1 ) ne '#';
Branch: 1 branch
BranchTrueFalseTotal
if $rest ne "" and substr($rest, 0, 1) ne "#" 4 909 913
Condition100%3/3
$rest ne "" and substr($rest, 0, 1) ne "#"
!ll&&!rl&&r
90544
MC/DC100%2/2
$rest ne "" and substr($rest, 0, 1) ne "#"
$rest ne "" substr($rest, 0, 1) ne "#"
Truth table100%3/3
A and B
A= $rest ne ""B= substr($rest, 0, 1) ne "#"
ABresult
0X0
100
111
356 }
357  
358 45767 ▶sub _char { $_[1] < length $_[0] ? substr( $_[0], $_[1], 1 ) : '' }
Subroutine _char: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
$_[1] < length $_[0] ? : 45759 8 45767
359  
360 # A scalar inside a flow collection: quoted, or plain up to `,` or the closing bracket.
361 897 ▶sub _flow_scalar {
Subroutine _flow_scalar: called CC=10 SCAR=23.1
362 897 my ( $s, $i, $closer, $line ) = @_;
363 897 ▶ $i++ while _char( $s, $i ) eq ' ' || _char( $s, $i ) eq "\t";
Branch: 1 branch
BranchTrueFalseTotal
_char($s, $i) eq " " || _char($s, $i) eq "\t" and do { ++$i } 106 897 1003
Condition66%2/3
_char($s, $i) eq " " or _char($s, $i) eq "\t"
l!l&&r!l&&!r
1060897
MC/DC50%1/2
_char($s, $i) eq " " or _char($s, $i) eq "\t"
_char($s, $i) eq " " _char($s, $i) eq "\t"
Truth table66%2/3
A or B
A= _char($s, $i) eq " "B= _char($s, $i) eq "\t"
ABresult
1X1
011
000
364 897 my $c = _char( $s, $i );
365 897 ▶ return _quoted( $s, $i, $line ) if $c eq '"' || $c eq "'";
Branch: 1 branch
BranchTrueFalseTotal
if $c eq "\"" or $c eq "'" 154 743 897
Condition100%3/3
$c eq "\"" or $c eq "'"
l!l&&r!l&&!r
1495743
MC/DC100%2/2
$c eq "\"" or $c eq "'"
$c eq "\"" $c eq "'"
Truth table100%3/3
A or B
A= $c eq "\""B= $c eq "'"
ABresult
1X1
011
000
366 743 ▶ _fail( $line, 'nested collections are not supported' ) if $c eq '[' || $c eq '{';
Branch: 1 branch
BranchTrueFalseTotal
if $c eq "[" or $c eq "{" 5 738 743
Condition66%2/3
$c eq "[" or $c eq "{"
l!l&&r!l&&!r
50738
MC/DC50%1/2
$c eq "[" or $c eq "{"
$c eq "[" $c eq "{"
Truth table66%2/3
A or B
A= $c eq "["B= $c eq "{"
ABresult
1X1
011
000
367 738 my $j = $i;
368 738 ▶ $j++ while $j < length $s && _char( $s, $j ) ne ',' && _char( $s, $j ) ne $closer;
Branch: 1 branch
BranchTrueFalseTotal
$j < length $s and _char($s, $j) ne "," and _char($s, $j) ne $closer and do { ++$j } 17716 738 18454
Condition100%6/6
$j < length $s and _char($s, $j) ne "," and _char($s, $j) ne $closer
!ll&&!rl&&r
8365517716
$j < length $s and _char($s, $j) ne ","
!ll&&!rl&&r
28118371
MC/DC100%3/3
$j < length $s and _char($s, $j) ne "," and _char($s, $j) ne $closer
$j < length $s _char($s, $j) ne "," _char($s, $j) ne $closer
Truth table100%4/4
A and B and C
A= $j < length $sB= _char($s, $j) ne ","C= _char($s, $j) ne $closer
ABCresult
0XX0
10X0
1100
1111
369 738 return ( _typed_plain( js_trim( substr $s, $i, $j - $i ) ), $j );
370 }
371  
372 892 ▶sub _flow_separator {
Subroutine _flow_separator: called CC=5 SCAR=16.1
373 892 my ( $s, $j, $closer, $line ) = @_;
374 892 ▶ $j++ while _char( $s, $j ) eq ' ' || _char( $s, $j ) eq "\t";
Branch: 1 branch
BranchTrueFalseTotal
_char($s, $j) eq " " || _char($s, $j) eq "\t" and do { ++$j } 1 892 893
Condition66%2/3
_char($s, $j) eq " " or _char($s, $j) eq "\t"
l!l&&r!l&&!r
10892
MC/DC50%1/2
_char($s, $j) eq " " or _char($s, $j) eq "\t"
_char($s, $j) eq " " _char($s, $j) eq "\t"
Truth table66%2/3
A or B
A= _char($s, $j) eq " "B= _char($s, $j) eq "\t"
ABresult
1X1
011
000
375 892 ▶ return ( 0, $j + 1 ) if _char( $s, $j ) eq ',';
Branch: 1 branch
BranchTrueFalseTotal
if _char($s, $j) eq "," 88 804 892
376 804 ▶ return ( 1, $j + 1 ) if _char( $s, $j ) eq $closer;
Branch: 1 branch
BranchTrueFalseTotal
if _char($s, $j) eq $closer 802 2 804
377 2 _fail( $line, 'expected "," or "'.$closer.'"' );
378 }
379  
380 2642 ▶sub _inline {
Subroutine _inline: called CC=14 SCAR=26.4
381 2642 my ( $value, $line ) = @_;
382 2642 my $s = js_trim($value);
383 2642 ▶ _fail( $line, 'anchors, aliases and tags are not supported' ) if $s =~ /\A[&*!]/;
Branch: 1 branch
BranchTrueFalseTotal
if $s =~ /\A[&*!]/ 17 2625 2642
384 2625 my $c = _char( $s, 0 );
385 2625 ▶ if ( $c eq '"' || $c eq "'" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($c eq "\"" or $c eq "'") 111 2514 2625
Condition100%3/3
$c eq "\"" or $c eq "'"
l!l&&r!l&&!r
74372514
MC/DC100%2/2
$c eq "\"" or $c eq "'"
$c eq "\"" $c eq "'"
Truth table100%3/3
A or B
A= $c eq "\""B= $c eq "'"
ABresult
1X1
011
000
386 111 my ( $v, $j ) = _quoted( $s, 0, $line );
387 99 _assert_end( $s, $j, $line );
388 97 return $v;
389 }
390 2514 ▶ if ( $c eq '[' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($c eq "[") 798 1716 2514
391 798 my @arr;
392 798 ▶ if ( $s =~ /\A\[$WS*\]/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s =~ /\A\[$WS*\]/) 6 792 798
393 6 _assert_end( $s, index( $s, ']' ) + 1, $line );
394 6 return \@arr;
395 }
396 792 my $j = 1;
397 792 for ( ;; ) {
398 870 my ( $v, $k ) = _flow_scalar( $s, $j, ']', $line );
399 866 push @arr, $v;
400 866 my ( $done, $n ) = _flow_separator( $s, $k, ']', $line );
401 864 $j = $n;
402 864 ▶ last if $done;
Branch: 1 branch
BranchTrueFalseTotal
if $done 786 78 864
403 }
404 786 _assert_end( $s, $j, $line );
405 786 return \@arr;
406 }
407 1716 ▶ if ( $c eq '{' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($c eq "{") 27 1689 1716
408 27 my $obj = js_ordered();
409 27 ▶ if ( $s =~ /\A\{$WS*\}/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($s =~ /\A\{$WS*\}/) 6 21 27
410 6 _assert_end( $s, index( $s, '}' ) + 1, $line );
411 4 return $obj;
412 }
413 21 my $j = 1;
414 21 for ( ;; ) {
415 31 ▶ $j++ while _char( $s, $j ) eq ' ';
Branch: 1 branch
BranchTrueFalseTotal
_char($s, $j) eq " " and do { ++$j } 10 31 41
416 31 my $colon = index $s, ':', $j;
417 31 ▶ _fail( $line, 'expected `key: value` in a flow mapping' ) if $colon == -1;
Branch: 1 branch
BranchTrueFalseTotal
if $colon == -1 2 29 31
418 29 ( my $key = js_trim( substr $s, $j, $colon - $j ) ) =~ s/\A(["'])($DOT*)\1\z/$2/;
419 29 ▶ _fail( $line, 'bad key in a flow mapping' ) if $key eq '' || $key =~ /[,{}\[\]]/;
Branch: 1 branch
BranchTrueFalseTotal
if $key eq "" or $key =~ /[,{}\[\]]/ 2 27 29
Condition66%2/3
$key eq "" or $key =~ /[,{}\[\]]/
l!l&&r!l&&!r
2027
MC/DC50%1/2
$key eq "" or $key =~ /[,{}\[\]]/
$key eq "" $key =~ /[,{}\[\]]/
Truth table66%2/3
A or B
A= $key eq ""B= $key =~ /[,{}\[\]]/
ABresult
1X1
011
000
420 27 my ( $v, $k ) = _flow_scalar( $s, $colon + 1, '}', $line );
421 26 $obj->{$key} = $v;
422 26 my ( $done, $n ) = _flow_separator( $s, $k, '}', $line );
423 26 $j = $n;
424 26 ▶ last if $done;
Branch: 1 branch
BranchTrueFalseTotal
if $done 16 10 26
425 }
426 16 _assert_end( $s, $j, $line );
427 16 return $obj;
428 }
429 1689 return _typed_plain( _strip_comment($s) );
430 }
431  
432 package # hide from PAUSE
433 Skilletor::Frontmatter::Float;
434  
435 # A YAML float: JavaScript cannot tell 1 from 1.0, TOML can (Codex agents).
436 53 ▶sub new { my ( $class, $value ) = @_; return bless { value => $value }, $class }
Subroutine new: called CC=1 SCAR=0.0
437 45 ▶sub value { $_[0]{value} }
Subroutine value: called CC=1 SCAR=0.0
438  
439 package Skilletor::Frontmatter;
440  
441 469 1;
442  
443 __END__
« /usr/local/lib/perl5/site_perl/5.44.0/namespace/clean.pm ↑ Summary lib/Skilletor/Convert.pm »