line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CQL::Utils; |
2
|
|
|
|
|
|
|
|
3
|
11
|
|
|
11
|
|
69
|
use strict; |
|
11
|
|
|
|
|
61
|
|
|
11
|
|
|
|
|
1393
|
|
4
|
11
|
|
|
11
|
|
63
|
use warnings; |
|
11
|
|
|
|
|
31
|
|
|
11
|
|
|
|
|
335
|
|
5
|
11
|
|
|
11
|
|
75
|
use base qw( Exporter ); |
|
11
|
|
|
|
|
30
|
|
|
11
|
|
|
|
|
12010
|
|
6
|
|
|
|
|
|
|
our @EXPORT_OK = qw( indent xq renderPrefixes ); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
## not for public consumption |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub indent { |
11
|
54
|
|
100
|
54
|
0
|
129
|
my $level = shift || 0; |
12
|
54
|
|
|
|
|
260
|
return " " x $level; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub xq { |
16
|
16
|
|
100
|
16
|
0
|
56
|
my $string = shift || ''; |
17
|
16
|
|
|
|
|
26
|
$string =~ s/&/&/g; |
18
|
16
|
|
|
|
|
28
|
$string =~ s/</g; |
19
|
16
|
|
|
|
|
21
|
$string =~ s/>/>/g; |
20
|
16
|
|
|
|
|
54
|
return $string; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub renderPrefixes { |
24
|
8
|
|
|
8
|
0
|
16
|
my ($level, @prefixes) = @_; |
25
|
8
|
100
|
|
|
|
42
|
return '' if @prefixes == 0; |
26
|
1
|
|
|
|
|
3
|
my $buffer = indent($level)."\n"; |
27
|
1
|
|
|
|
|
3
|
for my $prefix (@prefixes) { |
28
|
1
|
|
|
|
|
5
|
$buffer .= indent($level+1)."\n"; |
29
|
1
|
50
|
|
|
|
4
|
$buffer .= indent($level+2)."".$prefix->getName()."\n" |
30
|
|
|
|
|
|
|
if $prefix->getName(); |
31
|
1
|
|
|
|
|
4
|
$buffer .= indent($level+2)."".$prefix->getIdentifier(). |
32
|
|
|
|
|
|
|
"\n"; |
33
|
1
|
|
|
|
|
3
|
$buffer .= indent($level+1)."\n"; |
34
|
|
|
|
|
|
|
} |
35
|
1
|
|
|
|
|
3
|
$buffer .= indent($level)."\n"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |