Branch Coverage

lib/ChordPro/Song.pm
Criterion Covered Total %
branch 546 972 56.1


line true false branch
125 235 0 unless $_[0] == 1
130 0 214 unless ref $meta eq "HASH"
133 0 214 if $main::options->{'verbose'}
137 0 214 if ($lines->[0] =~ /^##config:\s*json/)
142 0 0 if ($lines->[0] =~ /^# (.*)/) { }
151 0 0 if ($cf)
159 107 0 if (not $main::options->{'nosongconfig'} and $diag->{'file'})
160 0 107 if ($main::options->{'verbose'})
162 0 0 defined $this ? :
165 0 0 $this eq $_ ? :
168 0 107 if ($meta and $meta->{'__config'}) { }
170 0 0 if $main::options->{'verbose'}
172 0 0 unless $have
178 158 56 if $cf eq $diag->{'file'}
179 214 0 unless fs_test("s", $cf)
180 0 0 if $main::options->{'verbose'}
189 0 0 if $main::options->{'verbose'}
192 0 0 if ($tuncheck ne join("|", @{$main::config->{'tuning'};}))
195 0 0 if $res
199 0 0 if ($chords)
201 0 0 if (@$c and $c->[0] eq "append")
208 0 0 if $res
211 0 0 if ($main::options->{'verbose'} > 1)
212 0 0 if $chords
227 0 214 if (my $a = $main::config->{'parser'}{'altbrackets'})
228 0 0 unless length $a == 2
232 0 214 if (%$defs)
237 838 18 unless defined $main::options->{$_}
241 0 214 unless (UNIVERSAL::isa($main::config->{'instrument'}, "HASH"))
253 0 856 if not $v or $v->{'type'} eq "none"
262 214 0 unless is_arrayref($v)
263 0 214 if (is_arrayref($meta->{$_})) { }
275 2 212 if ($target) { }
276 2 0 unless ("ChordPro::Chords::Parser"->have_parser($target))
277 2 0 if (my $file = CP()->findres("config/notes/$target.json"))
285 0 2 unless ("ChordPro::Chords::Parser"->have_parser($target))
288 0 2 if $main::options->{'verbose'}
292 0 2 if ($target ne $p->{'system'})
307 214 0 if $meta
315 0 214 if ($main::options->{'meta'})
321 12 202 unless $main::running_under_test
324 3 211 if ($main::config->{'settings'}{'memorize'}) { }
333 0 2201 if ($skipcnt) { }
363 0 2201 if ($main::config->{'debug'}{'echo'})
370 97 2104 if $pp eq "env-$in_context" and /^\s*\{(\w+)\}\s*$/ and $self->parse_directive($1)->{'name'} eq "end_of_$in_context"
371 0 4305 if ($prep->{$pp})
372 0 0 if $main::config->{'debug'}{'pp'}
374 0 0 if $main::config->{'debug'}{'pp'}
375 0 0 if (/\n/)
384 4 2197 if ($skip_context)
385 2 2 if (/^\s*\{(\w+)\}\s*$/)
387 2 0 if ($dir->{'name'} eq "end_of_$in_context")
395 63 2134 if (/^\s*\{((?:new_song|ns)\b.*)\}\s*$/)
396 29 34 if ($self->{'body'})
402 0 34 unless my $kv = parse_kv($dir->{'arg'} // "")
403 0 34 if (defined $kv->{'toc'})
406 0 34 if ($kv->{'forceifempty'})
415 57 2077 if (/^#/)
420 3 54 if (/^##(image|asset|include)(?:-(.+))?:\s+(.*)/i and $self->selected($2))
426 2 55 if ($kw eq "image")
428 0 2 unless ($id)
446 0 2 if ($info->{'error'})
462 0 2 if ($main::config->{'debug'}{'images'})
466 0 0 $kv->{'persist'} ? :
472 1 54 if ($kw eq "asset")
475 0 1 unless ($id)
479 0 1 unless ($type)
483 0 1 unless (exists $main::config->{'delegates'}{$type})
505 0 1 if ($main::config->{'debug'}{'images'})
508 0 0 $kv->{'persist'} ? :
514 0 54 if ($kw eq "include")
515 0 0 if ($kv->{'end'}) { }
521 0 0 if ($uri and CP()->is_here($uri))
523 0 0 if ($found) { }
531 0 0 if ($uri)
547 6 39 unless exists $$main::config{lc $self->{'generate'}} and exists $$main::config{lc $self->{'generate'}}{'comments'} and $$main::config{lc $self->{'generate'}}{'comments'} eq "retain"
549 39 0 if (exists $self->{'title'} or $fragment) { }
559 64 2013 if ($in_context eq "tab")
560 49 15 unless (/^\s*\{(?:end_of_tab|eot)\}\s*$/)
566 11 2017 if (exists $main::config->{'delegates'}{$in_context})
568 2 9 if (/^\s*\{(?:end_of_\Q$in_context\E)\}\s*$/) { }
574 2 0 if ($d->{'type'} eq "image")
579 2 0 unless ($id)
581 0 2 unless eval "require $pkg"
582 2 0 if (my $c = $pkg->can("options"))
588 2 0 unless (is_true($opts->{'omit'}))
589 0 0 if ($opts->{'align'} and $opts->{'x'} and $opts->{'x'} =~ /\%$/)
597 0 2 if (defined $opts->{'spread'})
599 0 0 if (exists $self->{'spreadimage'}) { }
606 0 0 if $main::config->{'debug'}{'images'}
612 1 1 if ($def) { }
614 0 1 if $label
619 0 1 if $label and $label ne ""
626 0 1 if ($opts->{'label'})
629 0 0 unless $in_context eq "chorus" and not $main::config->{'settings'}{'choruslabels'}
637 9 0 if ($self->{'body'} and @{$self->{'body'};} and $self->{'body'}[-1]{'context'} eq $in_context and $self->{'body'}[-1]{'open'}) { }
653 1204 815 if (/^\s*\{(.*)\}\s*$/)
655 0 1204 if ($prep->{'directive'})
656 0 0 if $main::config->{'debug'}{'pp'}
658 0 0 if $main::config->{'debug'}{'pp'}
660 1 1203 unless $self->directive($dir)
666 0 513 if (/\S/ and not $fragment and not exists $self->{'title'})
673 0 815 if ($in_context eq "tab")
679 39 776 if ($in_context eq "grid")
683 0 776 if ($in_context eq "grille" and @grille)
689 474 302 if (/\S/) { }
302 0 elsif (exists $self->{'title'} or $fragment) { }
690 0 474 if ($prep->{'songline'})
691 0 0 if $main::config->{'debug'}{'pp'}
693 0 0 if $main::config->{'debug'}{'pp'}
695 0 474 if ($main::config->{'settings'}{'flowtext'} and @{$self->{'body'} // [];}) { }
699 0 0 if ($prev->{'type'} eq 'songline' and not $prev->{'chords'} and not $this->{'chords'}) { }
720 0 214 if $in_context
726 0 214 if $main::options->{'verbose'}
730 0 214 if $main::config->{'debug'}{'assets'} & 1
731 0 214 if $main::config->{'debug'}{'song'} > 1
733 1 213 if (@labels)
742 0 0 unless $info
745 0 0 if ($xc)
752 2 452 unless is_true($v->{'diagram'} // 1)
754 2 945 if ($suppress{$_}) { }
757 6 208 if (exists $self->{'settings'}{'diagrams'}) { }
765 0 214 if ($diagrams =~ /^(user|all)$/ and not "ChordPro::Chords::Parser"->get_parser($target, 1)->has_diagrams)
768 0 0 unless $main::options->{'silent'}
772 0 214 if ($diagrams eq 'user') { }
774 0 0 if ($self->{'define'} and @{$self->{'define'};}) { }
777 0 0 $h{$_->{'name'}} ? :
785 616 329 if ($h{$_}++) { }
789 1 213 if ($main::config->{'diagrams'}{'sorted'})
798 49 165 if (%memchords) { }
799 0 49 if $main::config->{'debug'}{'chords'}
806 49 165 if (%memchords) { }
807 0 49 if $main::config->{'debug'}{'chords'}
814 130 84 if ($diagrams =~ /^(user|all)$/)
822 0 130 if (%warned_chords)
826 0 0 if (@a > 1) { }
837 0 214 if $main::config->{'debug'}{'song'} > 0
838 0 214 if $main::config->{'debug'}{'song'} < 0
839 0 214 if $main::config->{'debug'}{'songfull'}
846 0 1341 if $skip_context
849 1009 332 $lineinfo ? :
851 110 1231 if ($in_context eq "chorus")
863 0 991 unless length $orig
866 3 988 if ($orig =~ /^\*(.+)/ or $orig =~ /^(\||\s+)$/)
877 981 7 if ($markup eq $c)
883 0 988 if $c =~ s/^\((.*)\)$/$1/
888 8 980 unless (defined $info)
901 7 973 if ($markup) { }
973 0 elsif ((my $m = $orig) =~ s/\Q$c\E/%{formatted}/) { }
902 6 1 if ($markup =~ s/\>\Q$c\E\%{formatted}\(\Q$c\E\)\(%{formatted})
912 5 968 unless $m eq "%{formatted}"
920 966 14 unless ($info->is_nc or $info->is_note)
922 0 966 if ($main::config->{'instrument'}{'type'} eq 'keyboard') { }
766 200 elsif ($info->{'origin'}) { }
200 0 elsif ($main::running_under_test) { }
0 0 elsif (not $info->is_rootless || $info->has_diagram || !$info->parser->has_diagrams) { }
927 766 0 if $info->has_diagram
938 0 0 unless $warned_chords{$c}++
948 607 1 if $orig eq $line
952 249 359 if (@a <= 1)
953 0 249 $orig ? :
960 0 359 if (my $a = $main::config->{'parser'}{'altbrackets'})
965 126 233 if $a[0] eq ""
966 233 126 unless $a[0] =~ /$re_chords/
975 1040 44 if ($chord =~ s/^\[(.*)\]$/$1/ and $chord ne '^') { }
37 7 elsif ($memchords and $in_context and not $chord =~ /^\*/) { }
976 233 807 $chord eq '' ? :
977 222 84 if ($memchords and not $dummy and not $chord =~ /^\*/)
978 35 187 if ($memcrdinx == 0)
981 220 2 if ($memorizing)
982 0 220 $chord eq '' ? :
985 0 220 if $main::config->{'debug'}{'chords'}
993 1 36 if ($memcrdinx == 0 and @$memchords == 0) { }
0 36 elsif ($memcrdinx >= @$memchords) { }
1004 0 36 if $main::config->{'debug'}{'chords'}
1018 1 358 $orig ? :
1026 134 0 unless $no_substitute
1028 120 14 unless $res{'chords'}
1035 39 0 if $orig eq $line
1038 0 39 if $line eq ""
1043 0 39 if (not $line =~ /\|/) { }
1048 0 39 if ($line =~ /(.*\|\S*)\s([^\|]*)$/)
1051 0 0 unless $in_context eq "grille" or $grid_cells->[2]
1054 0 39 if ($line =~ /^([^|]+?)\s*(\|.*)/)
1057 0 0 unless $in_context eq "grille" or $grid_cells->[1]
1069 0 663 if (/\
1073 0 0 if m[\] and not m[\.*?\
1085 0 39 if (@tokens and uc($tokens[0]) =~ /^\|.*S/i)
1092 0 118 if (&is_gridstrum($grid_type) and is_strum($c)) { }
1103 0 663 if ($_ eq '|:' or $_ eq '{') { }
0 663 elsif (/^\|(\d+)(>?)$/) { }
0 663 elsif ($_ eq ':|' or $_ eq '}') { }
0 663 elsif ($_ eq ':|:' or $_ eq '}{') { }
149 514 elsif ($_ eq '|') { }
2 512 elsif ($_ eq '||') { }
0 512 elsif ($_ eq '|.') { }
0 512 elsif ($_ eq '%') { }
0 512 elsif ($_ eq '%%') { }
0 512 elsif ($_ eq '/') { }
395 117 elsif ($_ eq '.') { }
1105 0 0 if $memchords
1109 0 0 if $2
1113 0 0 if ($memchords)
1119 0 0 if ($memchords)
1135 0 0 if ($memchords and $p1)
1137 0 0 if ($main::config->{'debug'}{'chords'})
1146 0 0 if ($memchords and $p1)
1147 0 0 if $p2
1149 0 0 if ($main::config->{'debug'}{'chords'})
1166 116 1 if (@a == 1) { }
1173 0 2 $_ eq '/' ? :
0 2 if ($_ eq '.' or $_ eq '') { }
1180 117 0 if ($memchords and not &is_gridstrum($grid_type))
1184 0 117 if ($main::config->{'debug'}{'chords'})
1192 151 512 if ($_->{'class'} eq "bar")
1196 0 39 if ($nbt > $grid_cells->[0])
1199 0 39 $grid_type == 1 ? :
0 39 $grid_type == 2 ? :
1285 64 1708 unless ($dirpat)
1299 0 1772 if ($main::options->{'reference'} and $d =~ s/^\s*:[: ]*//)
1306 1129 643 if ($d =~ /^(.*?)([: ])\s*(.*)/)
1308 0 1129 if ($main::options->{'reference'})
1309 0 0 unless $2 eq ":"
1318 229 1543 if ($dir =~ /^($dirpat)-(.+)$/) { }
1320 113 116 unless ($self->selected($2))
1321 11 102 if ($dir =~ /^start_of_/) { }
1333 0 173 if ($dir =~ /^start_of_(.*)/ and exists $main::config->{'delegates'}{$1} and $main::config->{'delegates'}{$1}{'type'} eq "omit")
1345 3 229 unless defined $sel
1353 6 223 if $negate
1361 2 1202 if $dd->{'omit'} == 1
1365 948 254 if ($arg ne "")
1367 0 948 unless ($arg =~ /\S/)
1368 0 0 if ($dir =~ /^start_of_/) { }
1377 688 514 if ($directives{$dir})
1383 97 417 if ($dir =~ /^start_of_(\w+)$/)
1384 0 97 if $in_context
1387 2 95 if ($dd->{'omit'})
1392 29 66 if $in_context eq "chorus"
1396 26 69 if ($in_context eq 'grid' or $in_context eq 'grille' and not exists $main::config->{'delegates'}{$in_context}) { }
2 67 elsif (exists $main::config->{'delegates'}{$in_context}) { }
2 65 elsif ($arg ne '') { }
1401 0 26 if ($in_context eq 'grille') { }
4 22 elsif ($shape eq '') { }
22 0 elsif ($shape =~ /^ (?: (\d+) \+)? (\d+) (?: x (\d+) )? (?:\+ (\d+) )? (?:[:\s+] (.*)? )? $/x) { }
0 0 elsif ($shape ne '') { }
1413 0 22 unless $2
1416 0 22 if defined $5
1420 0 22 if defined $5
1428 0 26 if (($kv->{'label'} // "") ne "")
1436 26 0 if (($kv->{'cc'} //= "grid") ne "")
1445 0 26 if $in_context eq "grille"
1451 0 2 if ($xpose or $main::config->{'settings'}{'transpose'})
1456 2 0 if ($kv->{'label'} // "") eq ""
1463 0 2 exists $kv->{'id'} ? :
1465 0 2 if exists $kv->{'label'}
1471 0 2 if (%$kv) { }
2 0 elsif ($label) { }
1481 2 0 unless $in_context eq "chorus" and not $main::config->{'settings'}{'choruslabels'}
1483 0 2 if ($chords)
1490 0 0 if ($chords =~ /^(\w*):(.*)/) { }
0 0 elsif ($chords =~ /\s/) { }
0 0 elsif ($chords =~ /^\w+$/) { }
1492 0 0 if length $1
1507 0 0 if $chords
1511 0 0 if ($chords ne "")
1516 0 0 if ($main::config->{'debug'}{'chords'})
1537 95 322 if ($dir =~ /^end_of_(\w+)$/)
1538 0 95 unless $in_context eq $1
1541 0 95 if ($in_context eq 'grille' and @grille > 1) { }
1544 0 0 unless (is_true($opts->{'omit'}))
1545 0 0 if ($opts->{'align'} and $opts->{'x'} and $opts->{'x'} =~ /\%$/)
1553 0 0 if (defined $opts->{'spread'})
1555 0 0 if (exists $self->{'spreadimage'}) { }
1562 0 0 if $main::config->{'debug'}{'images'}
1577 0 0 if ($def) { }
1579 0 0 if $label
1584 0 0 if $label and $label ne ""
1591 0 0 if ($opts->{'label'})
1594 0 0 unless $in_context eq "chorus" and not $main::config->{'settings'}{'choruslabels'}
1611 238 84 if (&any(sub { $_ eq $dir; } , @{$$main::config{"metadata"}{"keys"};}))
1616 72 12 if ($dir =~ / ^( $propitems_re ) ( font | size | colou?r ) $/x)
1625 15 57 if $item eq "text"
1631 0 12 if (not $main::options->{'reference'} and $d =~ /^([-+])([-\w.]+)$/i)
1632 0 0 if ($2 eq "dumpmeta")
1635 0 0 $1 eq '+' ? :
1642 11 1 if (not $main::options->{'reference'} and $dir =~ /^\+([-\w.]+(?:\.[<>])?)$/)
1659 0 1 if $main::config->{'settings'}{'strict'} and not $d =~ /^x_/
1666 0 31 if ($in_context)
1672 29 2 @chorus ? :
1674 0 29 if (@$chorus and $arg and $arg ne "")
1677 0 0 if ($chorus->[0]{'type'} eq 'set' and $chorus->[0]{'name'} eq 'label') { }
0 0 elsif (defined $label) { }
1689 0 0 if $main::config->{'settings'}{'choruslabels'}
1692 17 14 if ($chorus_xpose != (my $xp = $xpose))
1695 16 16 if ($_->{'type'} eq "songline")
1697 15 46 if $_ eq ""
1699 0 46 if $info->is_annotation
1700 46 0 if $xp
1712 29 2 @$chorus ? :
1747 3 131 if $dir eq "highlight"
1751 134 0 unless exists $res{'text'} and $res{'text'} =~ /^[ \t]*$/
1757 1 6 if $main::running_under_test and not $arg
1762 2 4 if (@words and not $words[0] =~ /\w+=/) { }
1776 1 19 if ($k =~ /^(title)$/i and $v ne '') { }
4 15 elsif ($k =~ /^(border|spread|center|persist|omit)$/i and $v =~ /^(\d+)$/) { }
2 13 elsif ($k =~ /^(width|height)$/i and $v =~ /^(\d+(?:\.\d+)?\%?)$/) { }
2 11 elsif ($k =~ /^(x|y)$/i and $v =~ /^(?:base[+-])?([-+]?\d+(?:\.\d+)?\%?)$/) { }
3 8 elsif ($k =~ /^(scale)$/ and $v =~ /^(\d+(?:\.\d+)?)(%)?(?:,(\d+(?:\.\d+)?)(%)?)?$/) { }
0 8 elsif ($k =~ /^(center|border|spread|persist|omit)$/i) { }
2 6 elsif ($k =~ /^(src|uri)$/i and $v ne '') { }
4 2 elsif ($k =~ /^(id)$/i and $v ne '') { }
0 2 elsif ($k =~ /^(chord)$/i and $v ne '') { }
0 2 elsif ($k =~ /^(type)$/i and $v ne '') { }
0 2 elsif ($k =~ /^(label|href)$/i and $v ne '') { }
2 0 elsif ($k =~ /^(anchor)$/i and $v =~ /^(paper|page|allpages|column|float|line)$/) { }
0 0 elsif ($k =~ /^(align)$/i and $v =~ /^(center|left|right)$/) { }
0 0 elsif ($k =~ /^(bordertrbl)$/i and $v =~ /^[trbl]*$/) { }
0 0 elsif ($uri) { }
1781 1 3 if ($k eq 'center' and $v) { }
1798 0 3 $2 ? :
1799 0 0 $4 ? :
0 3 $3 ? :
1802 0 0 if ($k eq 'center') { }
1846 0 6 if is_true($opts{'omit'})
1848 0 4 unless ($uri or $id or $chord)
1852 0 1 if ($opts{'align'} and $opts{'x'} and $opts{'x'} =~ /\%$/)
1860 2 4 if ($uri and CP()->is_here($uri))
1863 2 0 if ($found) { }
1871 0 6 if $chord
1875 0 6 if (defined $opts{'spread'})
1876 0 0 if (exists $self->{'spreadimage'}) { }
1883 0 0 if $main::config->{'debug'}{'images'}
1888 2 4 if ($uri)
1891 0 6 if defined $opts{$_}
1895 0 2 if defined $opts{$_}
1898 0 2 if ($id and %opts)
1906 0 2 if ($uri =~ /\.(\w+)$/ and exists $main::config->{'delegates'}{$1}) { }
1920 0 2 if $opts
1923 0 2 if ($main::config->{'debug'}{'images'})
1927 0 0 $a->{'subtype'} ? :
0 0 $a->{'delegate'} ? :
0 0 $opts->{'persist'} ? :
1930 0 2 if $id or defined $opts{'spread'}
1933 0 6 if ($opts{'label'})
1966 277 0 if ($arg =~ /([^ :]+)[ :]+(.*)/) { }
1969 270 7 if ($main::config->{'metadata'}{'autosplit'}) { }
1974 0 7 if $vals[0] eq ""
1979 0 277 if ($key eq "user" or $key eq "instrument")
1986 93 184 if ($key eq "key")
1995 0 93 unless $info
1999 0 93 unless $main::config->{'settings'}{'enharmonic-transpose'}
2001 0 93 if ($capo)
2003 0 0 if $decapo
2014 17 167 if ($key eq 'capo') { }
9 315 elsif ($key eq 'duration' and $val) { }
2016 1 16 if exists $m->{'capo'}
2019 16 0 if ($capo and $m->{'key'})
2020 4 12 if ($decapo) { }
2044 0 184 if ($main::config->{'metadata'}{'strict'} and not &any(sub { $_ eq $key; } , @{$$main::config{"metadata"}{"keys"};}))
2048 0 0 if $main::config->{'settings'}{'strict'}
2052 184 0 if (defined $val)
2054 0 184 if $self->{'meta'}{$key} and not is_arrayref($self->{'meta'}{$key})
2061 0 0 if $main::config->{'settings'}{'strict'}
2072 0 23 unless ($arg =~ /^(left|right|center|centre)$/i)
2076 1 22 lc $1 eq 'centre' ? :
2083 0 20 unless ($arg =~ /^(\d+)$/)
2089 20 0 unless (ref $main::config->{'settings'}{'columns'} eq "ARRAY" and $arg == @{$main::config->{'settings'}{'columns'};})
2106 3 0 if ($arg ne '') { }
2108 1 2 if $arg =~ /^(right|bottom|top|below)$/i
2134 34 21 if ($arg =~ /^([-+]?\d+)\s*$/) { }
2144 23 11 if ($m->{'key'})
2147 2 21 if $capo
2153 0 34 if $no_transpose
2163 21 0 if (@{$propstack{'transpose'};}) { }
2172 15 6 if ($m->{'key'})
2175 0 15 if $capo and $decapo
2179 12 9 unless (@{$propstack{'transpose'};})
2182 0 21 if $no_transpose
2192 23 64 if $prop eq "colour"
2196 2 85 if ($value eq "")
2199 2 0 if (@{$propstack{$name};}) { }
2203 0 2 if ($prop eq "font" and $old =~ /\s(\d+(?:\.\d+)?)$/)
2210 0 0 @{$propstack{"$item-size"};} ? :
2218 2 0 if (@{$propstack{$name};}) { }
2227 0 2 if @toadd
2231 24 61 if ($prop eq "size")
2232 0 24 unless ($value =~ /^\d+(?:\.\d+)?\%?$/)
2237 37 48 if ($prop eq "color")
2239 0 37 unless ($v = get_color($value))
2245 24 61 $prop eq 'font' ? :
2253 0 85 if ($prop eq "font" and $value =~ /\s(\d+(?:\.\d+)?)$/)
2264 989 57 if ($new_id) { }
2265 11 978 if ($new_id eq 1)
2288 2 70 unless @a
2302 11 151 if ($a eq 'copy' or $a eq 'copyall') { }
2 149 elsif ($a eq 'display' and @a) { }
9 140 elsif ($a eq 'format' and @a) { }
46 94 elsif ($a eq 'base-fret') { }
57 37 elsif ($a eq 'frets') { }
16 21 elsif ($a eq 'fingers') { }
8 13 elsif ($a eq 'keys') { }
13 0 elsif ($a eq 'diagram' and @a > 0) { }
2303 11 0 if (my $i = ChordPro::Chords::known_chord($a[0])) { }
2319 0 2 unless $kv{'display'} eq shift @a
2321 0 2 unless defined $kv{'display'}
2331 46 0 if ($a[0] =~ /^\d+$/) { }
2346 57 0 if (@f == $strings) { }
2347 302 40 $_ =~ /^\d+/ ? :
2363 90 6 if (/^[0-9]+$/) { }
0 6 elsif (/^[A-MO-WYZ]$/) { }
6 0 elsif (/^[-xNX]$/) { }
2377 16 0 if (@f == $strings) { }
2394 8 0 if (@f) { }
2405 0 13 if ($show and not is_true($a[0]))
2423 0 72 if $fail
2431 71 1 if ($info) { }
2438 9 62 if ($show)
2449 61 11 unless defined $_
2454 0 11 if ($kv{'copyall'})
2460 11 133 if defined $kv{$_}
2464 13 59 if (defined $kv{'diagram'})
2466 7 6 if (is_true($v)) { }
2467 6 1 if (is_ttrue($v))
2480 294 138 unless defined $kv{$_}
2486 9 63 $show ? :
2490 9 63 if ($show)
2494 2 7 if (defined $self->{'body'} and $self->{'body'}[-1]{'type'} eq 'diagrams') { }
2509 256 248 unless defined $res->{$_}
2514 0 63 if ($ret)
2519 0 63 unless $info
2521 0 63 if $main::config->{'debug'}{'x1'}
2529 9 0 if ($dur =~ /(?:(?:(\d+):)?(\d+):)?(\d+)/)
2530 0 9 $2 ? :
0 9 $1 ? :
2575 0 1169 if $debug
2578 4 1165 if $capo and $decapo
2584 74 1095 if $def
2587 881 288 if ($info) { }
2589 0 881 if $debug > 1
2590 7 874 if $info->is_nc
2592 0 874 if $debug > 1
2598 0 288 if $info and $debug > 1
2602 22 1140 if ($def || $xp || $xc and not $info && $info->is_xpxc)
2609 8 1 unless ($info and $info->is_xpxc or $def and not $xc || $xp)
2616 0 0 $xp ? :
0 0 $xc ? :
0 8 if $xp or $xc or $main::config->{'debug'}{'chords'}
2619 158 0 if ($xp and $info and not $xc && ($xc eq 'nashville' || $xc eq 'roman'))
2625 158 0 unless $i eq $info
2630 0 0 $self->{'meta'}{'key'} ? :
0 158 if $debug > 1
2635 1153 9 if ($info)
2637 879 274 if (my $i = ChordPro::Chords::known_chord($info)) { }
0 274 elsif ($main::config->{'instrument'}{'type'} eq 'keyboard' and my $k = ChordPro::Chords::get_keys($info)) { }
2640 0 879 if $debug > 1
2643 90 789 $info->{'xp'} ? :
0 879 $info->{'xc'} ? :
2649 0 0 if $debug > 1
2655 0 274 if $debug
2662 20 1142 if ($xc and $info)
2665 20 0 if $self->{'meta'}{'key'}
2666 0 20 if ($xcmov and not defined $key_ord)
2672 20 0 unless $i eq $info
2677 0 0 defined $key_ord ? :
0 20 if $debug > 1
2679 8 12 if (my $i = ChordPro::Chords::known_chord($info))
2680 0 8 if $debug > 1
2687 9 1153 unless ($info)
2688 0 9 if (my $i = ChordPro::Chords::known_chord($chord))
2692 0 0 if $debug > 1
2697 8 1154 unless ($info or $def)
2698 1 7 if ($main::config->{'debug'}{'chords'} or not $warned_chords{$chord}++)
2699 0 1 if $debug
2700 1 0 unless $chord =~ /^n\.?c\.?$/i
2705 1153 9 if ($info)
2707 0 1153 unless $main::config->{'settings'}{'enharmonic-transpose'}
2708 0 0 $unk ? :
0 1153 if $debug > 1
2717 0 9 if $debug
2730 0 13 if $self->{'structure'} eq "structured"
2736 56 183 if ($item->{'type'} eq "empty" and $item->{'context'} eq $def_context)
2740 36 147 if ($item->{'type'} eq "songline" and $item->{'context'} eq "")
2743 43 140 if ($context ne $item->{'context'})
2746 135 48 if ($context) { }
2761 0 0 if ($full == 2)
2766 0 0 unless ($full)