script/sqlpp

filter: Statementstmt 69.5% 311 / 447 Branchbran 51.2% 171 / 334 Conditioncond 42.8% 60 / 140 MC/DCmcdc 29.1% 23 / 79 Subroutinesub 84.3% 27 / 32 Podpod n/a totaltotal 57.3% 592 / 1032 CC 218 SCAR 58.5
CC
218
Cov
59%
parse_comment
710.7
parse_argv
605.9
parse_pragma
132.0
CRAP 347.3
↑ Summary lib/bin/sqlpp.pm »
1 #!/usr/local/bin/perl -w
2
3 # $Id: sqlpp,v 1.15 2007/03/24 12:22:30 dk Exp $
4
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use vars qw($input $output @inc @context $context $sigdie %defines %macros $debug $VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use vars qw(%global); # for perldef
Subroutine BEGIN: called CC=1 SCAR=0.0
8
9 1 $VERSION = '0.06';
10
11 # special predefined macros
12 %defines = (
13 __LINE__ => {
14 0 ▶ code => sub { $context->{line} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
15 },
16 __FILE__ => {
17 0 ▶ code => sub { $context->{file} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
18 },
19 __VERSION__ => {
20 0 ▶ code => sub { $VERSION },
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 },
22 '#' => {
23 num => 1,
24 name => '#',
25 1 ▶ code => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
26 1 my $x = $_[0];
27 1 $x =~ s/([\\'])/\\$1/gs;
28 1 "'$x'";
29 },
30 },
31 1 );
32
33 1 ▶use constant MACRO_OFF => 0; # none
Subroutine BEGIN: called CC=1 SCAR=0.0
34 1 ▶use constant MACRO_SIMPLE => 1; # #defines with no-parameters only
Subroutine BEGIN: called CC=1 SCAR=0.0
35 1 ▶use constant MACRO_COMPLEX => 2; # #defines with parameters only
Subroutine BEGIN: called CC=1 SCAR=0.0
36 1 ▶use constant MACRO_ALL => 3; # all #defines
Subroutine BEGIN: called CC=1 SCAR=0.0
37
38 # run
39 1 $debug = 0;
40
41 1 $context = new_context( file => 'command line', macro => MACRO_OFF );
42 1 parse_argv();
43
44 1 $context = new_context();
45 1 parse_input();
46
47
48 # used for serving 'defined' call from #if, which is basically perl code
49 0 ▶sub is_defined { exists ($defines{$_[0]}) ? 1 : 0 }
Subroutine is_defined: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
exists $main::defines{$_[0]} ? : 0 0 0
50
51 1 ▶$SIG{__DIE__} = sub {
Subroutine __ANON__: called CC=2 SCAR=7.2
52 # avoid multiple wrappings by perl's "use" - careful when recovering from an eval!
53 1 ▶ die @_ if $sigdie++;
Branch: 1 branch
BranchTrueFalseTotal
if $main::sigdie++ 0 1 1
54
55 1 die "error in `$context->{file}', line #$context->{line}: ", @_, "\n";
56 1 };
57 1 parse_file(1);
58 0 exit;
59
60 # a context defines state of parser in a file
61 sub new_context
62 2 ▶{
Subroutine new_context: called CC=1 SCAR=0.0
63 {
64 2 line => 0,
65 buf => '',
66 in_comment => 0,
67 ifdef => [{state => 1,passive=>[]}],
68 in_sql => 0,
69 macro => MACRO_ALL,
70 strip => 1,
71 @_
72 }
73 }
74
75 # does buffered input
76 sub getline
77 131 ▶{
Subroutine getline: called CC=4 SCAR=14.5
78 131 my $undef_if_eof = $_[0];
79 131 ▶ if ( length $context->{buf}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $main::context->{"buf"}) 17 114 131
80 17 my $ret = $context->{buf};
81 17 $context->{buf} = '';
82 17 return $ret;
83 }
84 114 my $ret;
85 114 ▶ unless ( defined ($ret = <$input>)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($ret = readline $main::input)) { } 114 0 114
86 0 ▶ die "Unexpected end of input\n" unless $undef_if_eof;
Branch: 1 branch
BranchTrueFalseTotal
unless $undef_if_eof 0 0 0
87 } else {
88 114 $context->{line}++;
89 }
90 114 $ret;
91 }
92
93 # skips input until the EOL
94 43 ▶sub eatline { $context->{buf} = '' }
Subroutine eatline: called CC=1 SCAR=0.0
95
96 # returns next token from input stream
97 sub gettok
98 28 ▶{
Subroutine gettok: called CC=4 SCAR=19.4
99 28 while ( 1) {
100 28 ▶ unless ( length $context->{buf}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (length $main::context->{"buf"}) 0 28 28
101 0 ▶ unless ( defined ($context->{buf} = <$input>)) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined($main::context->{"buf"} = readline $main::input)) 0 0 0
102 0 die "Unexpected end of input\n";
103 }
104 0 chomp $context->{buf};
105 0 $context->{line}++;
106 }
107
108 28 $context->{buf} =~ s/^\s+//;
109
110 return $1
111 28 ▶ if $context-> {buf} =~ s/^(\w+|\S)//;
Branch: 1 branch
BranchTrueFalseTotal
if $main::context->{"buf"} =~ s/^(\w+|\S)// 28 0 28
112 }
113 }
114
115 # returns ID from input stream
116 sub getid
117 28 ▶{
Subroutine getid: called CC=2 SCAR=7.1
118 28 my $tok = gettok;
119 28 ▶ die "Identificator expected\n" unless $tok =~ /^\w+$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $tok =~ /^\w+$/ 0 28 28
120 28 $tok;
121 }
122
123 # Line handle is a state of the parser as it progresses through input .
124 # The idea is to avoid accumultaion of input until the end of input, and
125 # spew processed data as soon as possible. The calling routing thus is
126 # begin_line / while( not parse_line) / print end_line, with different
127 # variations.
128 #
129 # Currently, parse_line returns 0 ( a signal to call end_line ) when
130 # bracket balance is achieved - but there's a bug with macro
131 # call MACRO\n() where MACRO and () are on different lines.
132
133 2 ▶sub new_line_handle { {} }
Subroutine new_line_handle: called CC=1 SCAR=0.0
134
135 sub begin_line
136 47 ▶{
Subroutine begin_line: called CC=2 SCAR=6.9
137 47 ▶ my $k = $_[0] || new_line_handle;
Condition66%2/3
$_[0] || new_line_handle()
l!l&&r!l&&!r
4520
MC/DC0%0/2
$_[0] || new_line_handle()
$_[0] new_line_handle()
Truth table66%2/3
A || B
A= $_[0]B= new_line_handle()
ABresult
1X1
011
000
138 47 $k-> {var} = ''; # text to parse
139 47 $k-> {ids} = []; # stack of IDs met, f.ex. if var="A(b,C(d,", then ids=(A,C)
140 47 $k-> {last_id} = ''; # a candidate to ids
141 47 $k-> {last_pos} = 0; # stores pos(var) between calls
142 47 $k-> {storage} = [ 'copy', 0 ]; # accululates parsed info, to be run throung substitute_parameters later
143 47 $k-> {run_stack}= []; # stack of macro calls
144 47 $k-> {run} = $k-> {storage};# current macro call context
145 47 $k;
146 }
147
148 sub parse_line
149 52 ▶{
Subroutine parse_line: called CC=54 SCAR=45.9
150 52 my $k = $_[0];
151 52 ▶ $k-> {last_pos} = pos( $k-> {var}) || 0;
Condition100%2/2
pos $k->{'var'} || 0
l!l
646
MC/DC100%1/1
pos $k->{'var'} || 0
pos $k->{'var'}
Truth table100%2/2
A
A= pos $k->{'var'}
Aresult
11
00
152 52 $k-> {var} .= $_[1];
153 52 my $full = $context-> {macro} & MACRO_COMPLEX;
154 52 my $simple = $context-> {macro} & MACRO_SIMPLE;
155 52 pos( $k-> {var}) = $k-> {last_pos};
156 {
157 # do comments
158 52 ▶ $context->{multiline_comment} and $k-> {var} =~ m/\G.*?(\*\/)?/gcs and do {
Branch: 1 branch
BranchTrueFalseTotal
$main::context->{"multiline_comment"} and $k->{"var"} =~ m[\G.*?(\*/)?]cgs and do { $main::context->{"multiline_comment"} = 0 if $1; redo } 0 271 271
Condition33%1/3
$main::context->{"multiline_comment"} and $k->{"var"} =~ m[\G.*?(\*/)?]cgs
!ll&&!rl&&r
27100
MC/DC0%0/2
$main::context->{"multiline_comment"} and $k->{"var"} =~ m[\G.*?(\*/)?]cgs
$main::context->{"multiline_comment"} $k->{"var"} =~ m[\G.*?(\*/)?]cgs
Truth table33%1/3
A and B
A= $main::context->{"multiline_comment"}B= $k->{"var"} =~ m[\G.*?(\*/)?]cgs
ABresult
0X0
100
111
159 0 ▶ $context-> {multiline_comment} = 0 if $1;
Branch: 1 branch
BranchTrueFalseTotal
if $1 0 0 0
160 0 redo;
161 };
162 ( $k-> {var} =~ m/\G--/ or (
163 not $k-> {macro} and $k-> {var} =~ m/\G#/
164 271 ▶ )) and do {
Branch: 1 branch
BranchTrueFalseTotal
$k->{"var"} =~ /\G--/ || !$k->{"macro"} && $k->{"var"} =~ /\G#/ and do { if ($main::context->{"strip"}) { my $savepos = pos $k->{"var"}; $k->{"var"} =~ s/\G.*$//g; pos $k->{"var"} = $savepos; } elsif ($k->{"macro"}) { $k->{"var"} =~ /\G--/cg; } else { $k->{"var"} =~ /\G(--|#)/cg; } ; redo } 0 271 271
Condition50%3/6
$k->{"var"} =~ /\G--/ or not $k->{"macro"} and $k->{"var"} =~ /\G#/
l!l&&r!l&&!r
00271
not $k->{"macro"} and $k->{"var"} =~ /\G#/
!ll&&!rl&&r
871840
MC/DC0%0/3
$k->{"var"} =~ /\G--/ or not $k->{"macro"} and $k->{"var"} =~ /\G#/
$k->{"var"} =~ /\G--/ not $k->{"macro"} $k->{"var"} =~ /\G#/
Truth table50%2/4
A or not(B) and C
A= $k->{"var"} =~ /\G--/B= not $k->{"macro"}C= $k->{"var"} =~ /\G#/
ABCresult
1XX1
0111
00X0
0100
165 0 ▶ if ( $context->{strip}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($main::context->{'strip'}) { } 0 0 0
elsif ($k->{'macro'}) { } 0 0 0
166 0 my $savepos = pos( $k-> {var});
167 0 $k-> {var} =~ s/\G.*$//g;
168 0 pos( $k-> {var}) = $savepos;
169 } elsif ( $k-> {macro}) {
170 0 $k-> {var} =~ m/\G--/gc;
171 } else {
172 0 $k-> {var} =~ m/\G(--|#)/gc;
173 }
174 0 redo;
175 };
176 271 ▶ $k-> {var} =~ m/\G\/\*/gcs and do {
Branch: 1 branch
BranchTrueFalseTotal
$k->{"var"} =~ m[\G/\*]cgs and do { $main::context->{"multiline_comment"} = 1; redo } 0 271 271
177 0 $context-> {multiline_comment} = 1;
178 0 redo;
179 };
180 271 ▶ $k-> {var} =~ m/\G-+/gc and redo;
Branch: 1 branch
BranchTrueFalseTotal
$k->{"var"} =~ /\G-+/cg and redo 0 271 271
181
182 # do identifiers
183 271 ▶ $k-> {var} =~ m/\G(\w+)/gcs and do {
Branch: 1 branch
BranchTrueFalseTotal
$k->{"var"} =~ /\G(\w+)/cgs and do { if ($k->{"parameters"} and exists $k->{"parameters"}{$1}) { $k->{"last_id"} = ""; push @{$$k{"run"};}, pos($k->{"var"}) - length($1), "parameter", $k->{"parameters"}{$1}, "copy", pos $k->{"var"}; } elsif ($simple and exists $main::defines{$1}) { () = (length $1, $main::defines{$1}, pos $k->{"var"}); $k->{"last_id"} = ""; push @{$$k{"run"};}, $p - $l1, "define", $main::defines{$1}, "copy", $p; } else { $k->{"last_id"} = $1; $k->{"last_id_pos_start"} = pos($k->{"var"}) - length($1); } ; print qq[- id $k->{"last_id"}\n] if $main::debug; redo } 82 189 271
184 82 ▶ if ( $k->{parameters} and exists $k->{parameters}->{$1}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($k->{'parameters'} and exists $k->{'parameters'}{$1}) { } 10 72 82
elsif ($simple and exists $main::defines{$1}) { } 8 64 72
Condition100%3/3
$k->{"parameters"} and exists $k->{"parameters"}{$1}
!ll&&!rl&&r
531910
MC/DC100%2/2
$k->{"parameters"} and exists $k->{"parameters"}{$1}
$k->{"parameters"} exists $k->{"parameters"}{$1}
Truth table100%3/3
A and B
A= $k->{"parameters"}B= exists $k->{"parameters"}{$1}
ABresult
0X0
100
111
185 10 $k-> {last_id} = '';
186 10 push @{$k->{run}},
187 pos( $k->{var}) - length($1),
188 'parameter', $k->{parameters}->{$1},
189 10 'copy', pos( $k->{var});
190 ▶ } elsif ( $simple and exists $defines{$1}) {
Condition66%2/3
$simple and exists $main::defines{$1}
!ll&&!rl&&r
0648
MC/DC50%1/2
$simple and exists $main::defines{$1}
$simple exists $main::defines{$1}
Truth table66%2/3
A and B
A= $simpleB= exists $main::defines{$1}
ABresult
0X0
100
111
191 8 my ( $l1, $d, $p) = ( length( $1), $defines{$1}, pos($k->{var}));
192 8 $k-> {last_id} = '';
193 8 push @{$k->{run}},
194 $p - $l1,
195 8 'define', $defines{$1},
196 'copy', $p;
197 } else {
198 64 $k-> {last_id} = $1;
199 64 $k-> {last_id_pos_start} = pos($k-> {var}) - length($1);
200 }
201 82 ▶ print "- id $k->{last_id}\n" if $debug;
Branch: 1 branch
BranchTrueFalseTotal
if $main::debug 0 82 82
202 82 redo;
203 };
204
205 # do opening bracket
206 189 ▶ $full and $k-> {var} =~ m/\G\(\s*/gcs and do {
Branch: 1 branch
BranchTrueFalseTotal
$full and $k->{"var"} =~ /\G\(\s*/cgs and do { push @{$$k{"ids"};}, [$k->{"last_id"}, $main::context->{"line"}]; if (length $k->{"last_id"} and $main::macros{$k->{"last_id"}}) { push @{$$k{"run_stack"};}, $k->{"run"}; push @{$$k{"run"};}, $k->{"last_id_pos_start"}, "macro", $main::macros{$k->{"last_id"}}, ["copy", pos $k->{"var"}]; $k->{"run"} = $k->{"run"}[-1]; } ; $k->{"last_id"} = ""; print "- open\n" if $main::debug; redo } 24 165 189
Condition66%2/3
$full and $k->{"var"} =~ /\G\(\s*/cgs
!ll&&!rl&&r
016524
MC/DC50%1/2
$full and $k->{"var"} =~ /\G\(\s*/cgs
$full $k->{"var"} =~ /\G\(\s*/cgs
Truth table66%2/3
A and B
A= $fullB= $k->{"var"} =~ /\G\(\s*/cgs
ABresult
0X0
100
111
207 24 push @{$k-> {ids}}, [ $k-> {last_id}, $context->{line}];
208 24 ▶ if ( length $k->{last_id} and $macros{$k->{last_id}}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $k->{"last_id"} and $main::macros{$k->{"last_id"}}) 22 2 24
Condition66%2/3
length $k->{"last_id"} and $main::macros{$k->{"last_id"}}
!ll&&!rl&&r
2022
MC/DC50%1/2
length $k->{"last_id"} and $main::macros{$k->{"last_id"}}
length $k->{"last_id"} $main::macros{$k->{"last_id"}}
Truth table66%2/3
A and B
A= length $k->{"last_id"}B= $main::macros{$k->{"last_id"}}
ABresult
0X0
100
111
209 22 push @{$k->{run_stack}}, $k->{run};
210 22 push @{$k->{run}},
211 $k-> {last_id_pos_start},
212 'macro', $macros{$k->{last_id}},
213 [
214 22 'copy', pos($k->{var}),
215 ];
216 22 $k->{run} = $k->{run}->[-1];
217 }
218 24 $k-> {last_id} = '';
219 24 ▶ print "- open\n" if $debug;
Branch: 1 branch
BranchTrueFalseTotal
if $main::debug 0 24 24
220 24 redo;
221 };
222
223 # nulling ID after right after comments and IDs are processed is basically
224 # a grammar rule that states that in a macro call nothing except a comment
225 # and whitespace can be present between a macro ID and an opening bracket
226 165 ▶ $k-> {var} =~ m/\G\s+/gcs and redo;
Branch: 1 branch
BranchTrueFalseTotal
$k->{"var"} =~ /\G\s+/cgs and redo 53 112 165
227 112 $k-> {last_id} = '';
228
229 # do closing bracket
230 112 ▶ $full and $k-> {var} =~ m/\G(\s*\))/gcs and do {
Branch: 1 branch
BranchTrueFalseTotal
$full and $k->{"var"} =~ /\G(\s*\))/cgs and do { die "Brackets mismatch at character ", pos($k->{"var"}) - $k->{"last_pos"}, "\n" unless @{$k->{"ids"};}; my $id = pop(@{$$k{"ids"};})->[0]; print "- close [$id]\n" if $main::debug; if (length $id and $main::macros{$id}) { push @{$$k{"run"};}, pos($k->{"var"}) - length($1); $k->{"run"} = pop @{$$k{"run_stack"};}; push @{$$k{"run"};}, "copy", pos $k->{"var"}; } ; redo } 24 88 112
Condition66%2/3
$full and $k->{"var"} =~ /\G(\s*\))/cgs
!ll&&!rl&&r
08824
MC/DC50%1/2
$full and $k->{"var"} =~ /\G(\s*\))/cgs
$full $k->{"var"} =~ /\G(\s*\))/cgs
Truth table66%2/3
A and B
A= $fullB= $k->{"var"} =~ /\G(\s*\))/cgs
ABresult
0X0
100
111
231 die "Brackets mismatch at character ", pos($k-> {var})-$k-> {last_pos}, "\n"
232 24 ▶ unless @{$k-> {ids}};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$k->{"ids"};} 0 24 24
233 24 my $id = (pop @{$k->{ids}})->[0];
234 24 ▶ print "- close [$id]\n" if $debug;
Branch: 1 branch
BranchTrueFalseTotal
if $main::debug 0 24 24
235
236 24 ▶ if ( length $id and $macros{$id}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $id and $main::macros{$id}) 22 2 24
Condition66%2/3
length $id and $main::macros{$id}
!ll&&!rl&&r
2022
MC/DC50%1/2
length $id and $main::macros{$id}
length $id $main::macros{$id}
Truth table66%2/3
A and B
A= length $idB= $main::macros{$id}
ABresult
0X0
100
111
237 22 push @{$k->{run}}, pos($k->{var}) - length($1);
238 22 $k->{run} = pop @{$k->{run_stack}};
239 22 push @{$k->{run}}, 'copy', pos($k->{var});
240 }
241 24 redo;
242 };
243
244 # do next param
245 88 ▶ $full and $k-> {var} =~ m/\G(\s*,\s*)/gcs and do {
Branch: 1 branch
BranchTrueFalseTotal
$full and $k->{"var"} =~ /\G(\s*,\s*)/cgs and do { redo unless @{$k->{"ids"};}; if (length $k->{"ids"}[-1][0] and $main::macros{$k->{"ids"}[-1][0]} and @{$k->{"run_stack"};}) { push @{$$k{"run"};}, pos($k->{"var"}) - length($1), "next", "copy", pos $k->{"var"}; } ; redo } 16 72 88
Condition66%2/3
$full and $k->{"var"} =~ /\G(\s*,\s*)/cgs
!ll&&!rl&&r
07216
MC/DC50%1/2
$full and $k->{"var"} =~ /\G(\s*,\s*)/cgs
$full $k->{"var"} =~ /\G(\s*,\s*)/cgs
Truth table66%2/3
A and B
A= $fullB= $k->{"var"} =~ /\G(\s*,\s*)/cgs
ABresult
0X0
100
111
246 16 ▶ redo unless @{$k->{ids}};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$k->{"ids"};} 0 16 16
247
248 16 ▶ if ( length($k->{ids}->[-1]->[0]) and
Branch: 1 branch
BranchTrueFalseTotal
if (length $k->{"ids"}[-1][0] and $main::macros{$k->{"ids"}[-1][0]} and @{$k->{"run_stack"};}) 14 2 16
Condition66%4/6
length $k->{"ids"}[-1][0] and $main::macros{$k->{"ids"}[-1][0]} and @{$k->{"run_stack"};}
!ll&&!rl&&r
2014
length $k->{"ids"}[-1][0] and $main::macros{$k->{"ids"}[-1][0]}
!ll&&!rl&&r
2014
MC/DC33%1/3
length $k->{"ids"}[-1][0] and $main::macros{$k->{"ids"}[-1][0]} and @{$k->{"run_stack"};}
length $k->{"ids"}[-1][0] $main::macros{$k->{"ids"}[-1][0]} @{$k->{"run_stack"};}
Truth table50%2/4
A and B and C
A= length $k->{"ids"}[-1][0]B= $main::macros{$k->{"ids"}[-1][0]}C= @{$k->{"run_stack"};}
ABCresult
0XX0
10X0
1100
1111
249 14 $macros{$k->{ids}->[-1]->[0]} and @{$k->{run_stack}}) {
250 14 push @{$k->{run}},
251 pos($k-> {var}) - length($1),
252 'next',
253 'copy', pos($k-> {var})
254 14 }
255 16 redo;
256 };
257
258 # special # and ## operators
259 72 ▶ $k->{macro} and $k->{var} =~ /\G\#(?:(\#\s*)|(\s*)(\w+)|(.*))/gcs and do {
Branch: 1 branch
BranchTrueFalseTotal
$k->{"macro"} and $k->{"var"} =~ /\G\#(?:(\#\s*)|(\s*)(\w+)|(.*))/cgs and do { if (defined $1) { my $minus = 1 + length($1); ++$minus while $minus < pos $k->{"var"} and substr($k->{"var"}, pos($k->{"var"}) - $minus - 1, 1) eq " "; push @{$$k{"run"};}, pos($k->{"var"}) - $minus, "copy", pos $k->{"var"}; } elsif (defined $3 and exists $k->{"parameters"}{$3}) { push @{$$k{"run"};}, pos($k->{"var"}) - 1 - length($2) - length($3), "macro", $main::defines{"#"}, ["parameter", $k->{"parameters"}{$3}], "copy", pos $k->{"var"}; } else { die "'#' is not followed by a macro parameter (", defined $3 ? $3 : $4, ")\n"; } ; redo } 5 67 72
Condition100%3/3
$k->{"macro"} and $k->{"var"} =~ /\G\#(?:(\#\s*)|(\s*)(\w+)|(.*))/cgs
!ll&&!rl&&r
46215
MC/DC100%2/2
$k->{"macro"} and $k->{"var"} =~ /\G\#(?:(\#\s*)|(\s*)(\w+)|(.*))/cgs
$k->{"macro"} $k->{"var"} =~ /\G\#(?:(\#\s*)|(\s*)(\w+)|(.*))/cgs
Truth table100%3/3
A and B
A= $k->{"macro"}B= $k->{"var"} =~ /\G\#(?:(\#\s*)|(\s*)(\w+)|(.*))/cgs
ABresult
0X0
100
111
260 5 ▶ if ( defined $1) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $1) { } 3 2 5
elsif (defined $3 and exists $k->{'parameters'}{$3}) { } 1 1 2
261 # concatenation
262 3 my $minus = 1 + length($1);
263 $minus++ while
264 $minus < pos($k->{var}) and
265 3 ▶ substr( $k->{var}, pos($k->{var}) - $minus - 1, 1) eq ' ';
Branch: 1 branch
BranchTrueFalseTotal
$minus < pos $k->{"var"} and substr($k->{"var"}, pos($k->{"var"}) - $minus - 1, 1) eq " " and do { ++$minus } 3 3 6
Condition66%2/3
$minus < pos $k->{"var"} and substr($k->{"var"}, pos($k->{"var"}) - $minus - 1, 1) eq " "
!ll&&!rl&&r
033
MC/DC50%1/2
$minus < pos $k->{"var"} and substr($k->{"var"}, pos($k->{"var"}) - $minus - 1, 1) eq " "
$minus < pos $k->{"var"} substr($k->{"var"}, pos($k->{"var"}) - $minus - 1, 1) eq " "
Truth table66%2/3
A and B
A= $minus < pos $k->{"var"}B= substr($k->{"var"}, pos($k->{"var"}) - $minus - 1, 1) eq " "
ABresult
0X0
100
111
266 3 push @{$k->{run}},
267 pos($k->{var}) - $minus,
268 3 'copy', pos($k->{var});
269 ▶ } elsif ( defined $3 and exists $k->{parameters}->{$3}) {
Condition66%2/3
defined $3 and exists $k->{"parameters"}{$3}
!ll&&!rl&&r
101
MC/DC50%1/2
defined $3 and exists $k->{"parameters"}{$3}
defined $3 exists $k->{"parameters"}{$3}
Truth table66%2/3
A and B
A= defined $3B= exists $k->{"parameters"}{$3}
ABresult
0X0
100
111
270 # stringification
271 1 push @{$k->{run}},
272 pos($k->{var}) - 1 - length($2) - length($3),
273 'macro', $defines{'#'},
274 [ 'parameter', $k->{parameters}->{$3} ],
275 1 'copy', pos($k->{var});
276 } else {
277 1 ▶ die "'#' is not followed by a macro parameter (",
Branch: 1 branch
BranchTrueFalseTotal
defined $3 ? : 0 1 1
278 (( defined $3) ? $3 : $4),
279 ")\n";
280 }
281 4 redo;
282 };
283
284 # we do ''-only strings
285 67 ▶ $full and $k-> {var} =~ m/\G'[^']*'/gcs and redo;
Branch: 1 branch
BranchTrueFalseTotal
$full and $k->{"var"} =~ /\G'[^']*'/cgs and redo 1 66 67
Condition66%2/3
$full and $k->{"var"} =~ /\G'[^']*'/cgs
!ll&&!rl&&r
0661
MC/DC50%1/2
$full and $k->{"var"} =~ /\G'[^']*'/cgs
$full $k->{"var"} =~ /\G'[^']*'/cgs
Truth table66%2/3
A and B
A= $fullB= $k->{"var"} =~ /\G'[^']*'/cgs
ABresult
0X0
100
111
286
287 # everything else
288 66 ▶ if ( $full) {
Branch: 1 branch
BranchTrueFalseTotal
if ($full) { } 66 0 66
289 66 ▶ $k-> {var} =~ m/\G[^\w\(\)\'\-\,\#]+/gcs and redo;
Branch: 1 branch
BranchTrueFalseTotal
$k->{"var"} =~ /\G[^\w\(\)\'\-\,\#]+/cgs and redo 15 51 66
290 } else {
291 0 ▶ $k-> {var} =~ m/\G[^\w\-\#]+/gcs and redo;
Branch: 1 branch
BranchTrueFalseTotal
$k->{"var"} =~ /\G[^\w\-\#]+/cgs and redo 0 0 0
292 }
293 51 ▶ !$full and $k-> {var} =~ m/\G[\(\)\']+/gcs and redo;
Branch: 1 branch
BranchTrueFalseTotal
not $full and $k->{"var"} =~ /\G[\(\)\']+/cgs and redo 0 51 51
Condition33%1/3
not $full and $k->{"var"} =~ /\G[\(\)\']+/cgs
!ll&&!rl&&r
5100
MC/DC0%0/2
not $full and $k->{"var"} =~ /\G[\(\)\']+/cgs
not $full $k->{"var"} =~ /\G[\(\)\']+/cgs
Truth table33%1/3
not(A) and B
A= not $fullB= $k->{"var"} =~ /\G[\(\)\']+/cgs
ABresult
0X0
100
111
294
295 51 ▶ print "? stop at ", pos($k-> {var}), "\n" if $debug;
Branch: 1 branch
BranchTrueFalseTotal
if $main::debug 0 51 51
296 51 ▶ print +('.' x (pos($k-> {var})-1)), "v\n$k->{var}\n" if $debug;
Branch: 1 branch
BranchTrueFalseTotal
if $main::debug 0 51 51
297 }
298
299 51 ▶ return scalar(@{$k-> {ids}}) ? 0 : 1;
Branch: 1 branch
BranchTrueFalseTotal
scalar @{$k->{'ids'};} ? : 0 51 51
300 }
301
302 sub end_parse_line
303 45 ▶{
Subroutine end_parse_line: called CC=2 SCAR=7.0
304 45 my $k = $_[0];
305 die "Brackets don't match at character ", pos($k->{var}) - $k-> {last_pos}, ", line $k->{ids}->[-1]->[1]\n"
306 45 ▶ if @{$k-> {ids}};
Branch: 1 branch
BranchTrueFalseTotal
if @{$k->{"ids"};} 0 45 45
307 45 push @{$k->{run}}, length($k->{var});
308 45 delete @$k{qw(run run_stack last_id last_pos last_id_pos_start ids)};
309 }
310
311 # input:
312 # k - text reference object
313 # v - set of commands, where 'copy' referes to text chunks in k
314 # p - set of actual parameters to be substututed
315 # output:
316 # text with parameters substituted
317 sub substitute_parameters
318 70 ▶{
Subroutine substitute_parameters: called CC=9 SCAR=22.0
319 70 my ( $k, $v, $parameters) = @_;
320
321 70 my @output = ('');
322
323 70 ▶ for ( my $i = 0; $i < @$v; ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < @$v) 182 70 252
324 182 my $cmd = $v->[$i++];
325 182 ▶ if ( $cmd eq 'copy') {
Branch: 5 branches
BranchTrueFalseTotal
if ($cmd eq 'copy') { } 126 56 182
elsif ($cmd eq 'parameter') { } 13 43 56
elsif ($cmd eq 'next') { } 13 30 43
elsif ($cmd eq 'macro') { } 23 7 30
elsif ($cmd eq 'define') { } 7 0 7
326 126 $output[-1] .= substr( $k->{var}, $v->[$i], $v->[$i+1] - $v->[$i]);
327 126 $i += 2;
328 } elsif ( $cmd eq 'parameter') {
329 13 $output[-1] .= $parameters->[ $v->[$i++] ];
330 } elsif ( $cmd eq 'next') {
331 13 push @output, '';
332 } elsif ( $cmd eq 'macro') {
333 23 $output[-1] .= execute_macro(
334 $v->[$i],
335 substitute_parameters( $k, $v->[$i+1], $parameters)
336 );
337 23 $i += 2;
338 } elsif ( $cmd eq 'define') {
339 7 $output[-1] .= execute_macro( $v->[$i++]);
340 } else {
341 0 die "Internal error: unknown directive `$cmd' (i=$i, stack=@$v)\n";
342 }
343 }
344
345 # XXX special case - zero parameters
346 70 ▶ return if 1 == @output and $output[0] eq '';
Branch: 1 branch
BranchTrueFalseTotal
if 1 == @output and $output[0] eq "" 3 67 70
Condition100%3/3
1 == @output and $output[0] eq ""
!ll&&!rl&&r
12553
MC/DC100%2/2
1 == @output and $output[0] eq ""
1 == @output $output[0] eq ""
Truth table100%3/3
A and B
A= 1 == @outputB= $output[0] eq ""
ABresult
0X0
100
111
347
348 67 return @output;
349 }
350
351 sub execute_macro
352 30 ▶{
Subroutine execute_macro: called CC=7 SCAR=22.9
353 30 my ( $handle, @params) = @_;
354
355 die sprintf "Macro `%s' requires %d argument%s, %d %s passed\n",
356 $handle->{name},
357 $handle->{num}, ( $handle->{num} == 1) ? '' : 's',
358 scalar(@params), (scalar(@params) == 1) ? 'was' : 'were'
359 unless $handle->{ellipsis} or
360 !defined($handle->{num}) or
361 30 ▶ $handle->{num} == scalar(@params);
Branch: 3 branches
BranchTrueFalseTotal
unless $handle->{"ellipsis"} or not defined $handle->{"num"} or $handle->{"num"} == scalar @params 0 30 30
$handle->{'num'} == 1 ? : 0 0 0
scalar @params == 1 ? : 0 0 0
Condition66%4/6
$handle->{"ellipsis"} or not defined $handle->{"num"} or $handle->{"num"} == scalar @params
l!l&&r!l&&!r
1290
$handle->{"ellipsis"} or not defined $handle->{"num"}
l!l&&r!l&&!r
1029
MC/DC0%0/3
$handle->{"ellipsis"} or not defined $handle->{"num"} or $handle->{"num"} == scalar @params
$handle->{"ellipsis"} not defined $handle->{"num"} $handle->{"num"} == scalar @params
Truth table50%2/4
A or not(B) or C
A= $handle->{"ellipsis"}B= not defined $handle->{"num"}C= $handle->{"num"} == scalar @params
ABCresult
1XX1
01X1
0011
0000
362
363 30 ▶ return join($", $handle->{code}->(@params)) if $handle-> {code};
Branch: 1 branch
BranchTrueFalseTotal
if $handle->{"code"} 17 13 30
364
365 return join('', substitute_parameters(
366 $handle,
367 $handle->{storage},
368 \@params
369 13 ));
370 }
371
372 sub end_line
373 34 ▶{
Subroutine end_line: called CC=1 SCAR=0.0
374 34 my $k = $_[0];
375 34 end_parse_line($k);
376 34 return join('', substitute_parameters( $k, $k->{storage}, [] ));
377 }
378
379 # begin_macro/end_macro pairs are same as begin_line/end_line, but for macro declaration purposes
380 sub begin_macro
381 12 ▶{
Subroutine begin_macro: called CC=4 SCAR=14.0
382 12 my ( $name, $parametric, @params ) = @_;
383
384 12 my %p;
385 12 my $pno = 0;
386 12 for my $p ( @params) {
387 die "Error in macros `$name' definition: argument `$p' is used twice\n"
388 11 ▶ if $p{$p};
Branch: 1 branch
BranchTrueFalseTotal
if $p{$p} 0 11 11
389 11 ▶ die "Error in macros `$name' definition: argument name `$p' is not a valid identifier\n"
Branch: 1 branch
BranchTrueFalseTotal
if $p =~ /\'\(\)\#/ 0 11 11
390 if $p =~ /\'\(\)\#/;
391 11 $p{$p} = $pno++;
392 }
393
394 return begin_line {
395 parametric => $parametric,
396 parameters => \%p,
397 name => $name,
398 macro => 1,
399 line => $context->{line},
400 file => $context->{file},
401 12 };
402 }
403
404 sub end_macro
405 11 ▶{
Subroutine end_macro: called CC=2 SCAR=6.9
406 11 my $handle = $_[0];
407 11 end_parse_line( $handle);
408
409 11 ▶ if ( $handle->{parametric}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($handle->{'parametric'}) { } 9 2 11
410 9 $macros{ $handle->{name} } = $handle;
411 9 $handle->{num} = scalar keys %{$handle->{parameters}};
412 } else {
413 2 $defines{ $handle->{name} } = $handle;
414 2 $handle->{num} = 0;
415 }
416 11 delete @$handle{qw(parametric macro)};
417 }
418
419 sub parse_pragma
420 0 ▶{
Subroutine parse_pragma: not called CC=11 SCAR=48.8
421 0 my ( $pragma, $param) = @_;
422 0 ▶ if ( $pragma eq 'macro') {
Branch: 3 branches
BranchTrueFalseTotal
if ($pragma eq 'macro') { } 0 0 0
elsif ($pragma eq 'comment') { } 0 0 0
elsif ($pragma eq 'lang') { } 0 0 0
423 0 ▶ if ( $param eq 'simple') {
Branch: 3 branches
BranchTrueFalseTotal
if ($param eq 'simple') { } 0 0 0
elsif ($param eq 'all') { } 0 0 0
elsif ($param eq 'off') { } 0 0 0
424 0 $context->{macro} = MACRO_SIMPLE;
425 } elsif ( $param eq 'all') {
426 0 $context->{macro} = MACRO_ALL;
427 } elsif ( $param eq 'off') {
428 0 $context->{macro} = MACRO_OFF;
429 } else {
430 0 die "Invalid '#pragma macro($param)': should be 'all', 'simple', or 'off'\n";
431 }
432 } elsif ( $pragma eq 'comment') {
433 0 ▶ if ( $param eq 'strip') {
Branch: 2 branches
BranchTrueFalseTotal
if ($param eq 'strip') { } 0 0 0
elsif ($param eq 'leave') { } 0 0 0
434 0 $context->{strip} = 1;
435 } elsif ( $param eq 'leave') {
436 0 $context->{strip} = 0;
437 } else {
438 0 die "Invalid '#pragma comments($param)': should be 'strip' or 'leave'\n";
439 }
440 } elsif ( $pragma eq 'lang') {
441 0 ▶ if ( $param eq 'sql') {
Branch: 2 branches
BranchTrueFalseTotal
if ($param eq 'sql') { } 0 0 0
elsif ($param eq 'perl') { } 0 0 0
442 0 parse_pragma(qw(macro all));
443 0 parse_pragma(qw(comment strip));
444 } elsif ( $param eq 'perl') {
445 0 parse_pragma(qw(macro simple));
446 0 parse_pragma(qw(comment leave));
447 } else {
448 0 die "Invalid '#pragma lang($param)': should be 'sql' or 'perl'\n";
449 }
450 } else {
451 0 die "Unknown #pragma $pragma\n";
452 }
453 }
454
455 # if a line begins with #, then parse_comment checks it first
456 sub parse_comment
457 63 ▶{
Subroutine parse_comment: called CC=86 SCAR=65.7
458 63 my $eatline = 1;
459 63 my $what;
460
461 63 ▶ if ( $context->{buf} !~ s/^(\w+)\s+//) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $main::context->{'buf'} =~ s/^(\w+)\s+//) { } 21 42 63
462 # a comment
463 21 eatline;
464 21 return;
465 } else {
466 42 $what = $1;
467 }
468
469 # parse if/else/elif/endif in the passive code less heavily
470 42 ▶ unless ( $context->{ifdef}->[-1]->{state}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($main::context->{"ifdef"}[-1]{"state"}) 6 36 42
471 6 ▶ if ( $what =~ /^if(n?def)?$/) {
Branch: 4 branches
BranchTrueFalseTotal
if ($what =~ /^if(n?def)?$/) { } 0 6 6
elsif ($what eq 'else') { } 3 3 6
elsif ($what eq 'elif') { } 0 3 3
elsif ($what eq 'endif') { } 3 0 3
472 0 push @{$context->{ifdef}->[-1]->{passive}}, 1; # flipsleft
473 } elsif ( $what eq 'else') {
474 3 ▶ goto NORMAL unless @{$context->{ifdef}->[-1]->{passive}};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$main::context->{"ifdef"}[-1]{"passive"};} 3 0 3
475 0 ▶ die "Too many #else\n" unless $context->{ifdef}->[-1]->{passive}->[-1]--;
Branch: 1 branch
BranchTrueFalseTotal
unless $main::context->{"ifdef"}[-1]{"passive"}[-1]-- 0 0 0
476 } elsif ( $what eq 'elif') {
477 0 ▶ goto NORMAL unless @{$context->{ifdef}->[-1]->{passive}};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$main::context->{"ifdef"}[-1]{"passive"};} 0 0 0
478 } elsif ( $what eq 'endif') {
479 3 ▶ goto NORMAL unless @{$context->{ifdef}->[-1]->{passive}};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$main::context->{"ifdef"}[-1]{"passive"};} 3 0 3
480 0 pop @{$context->{ifdef}->[-1]->{passive}};
481 }
482 0 eatline;
483 0 return;
484 }
485
486 # normal '#' pragmas
487 NORMAL:
488 42 ▶ if ( $what eq 'define') {
Branch: 12 branches
BranchTrueFalseTotal
if ($what eq 'define') { } 14 28 42
elsif ($what eq 'undef') { } 3 25 28
elsif ($what =~ /if(n?)def/) { } 6 19 25
elsif ($what eq 'if') { } 1 18 19
elsif ($what eq 'elif') { } 0 18 18
elsif ($what eq 'else') { } 6 12 18
elsif ($what eq 'endif') { } 7 5 12
elsif ($what eq 'error') { } 0 5 5
elsif ($what eq 'include') { } 0 5 5
elsif ($what eq 'pragma') { } 0 5 5
elsif ($what eq 'perldef') { } 5 0 5
elsif ($what =~ /^([\w\d_]+)/) { } 0 0 0
489 14 my $heredoc = $context->{buf} =~ s/^<<//;
490 14 my $def = getid();
491
492 14 my @params;
493 14 my $parametric = 0;
494 14 ▶ if ( $context->{buf} =~ s/^\(([^\)]*)\)//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($main::context->{"buf"} =~ s/^\(([^\)]*)\)//) 10 4 14
495 @params = map {
496 10 s/^\s*//;
497 11 s/\s*$//;
498 11 ▶ die "`$1' may not appear in macro parameter list\n"
Branch: 1 branch
BranchTrueFalseTotal
if /(\W)/ 0 11 11
499 if m/(\W)/;
500 11 $_
501 } split ',', $1;
502 10 $parametric = 1;
503 }
504 14 $context->{buf} =~ s/^\s*//;
505
506 14 $eatline = 0;
507 14 ▶ if ( $heredoc or length $context->{buf}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($heredoc or length $main::context->{'buf'}) { } 12 2 14
elsif ($parametric) { } 1 1 2
Condition100%3/3
$heredoc or length $main::context->{"buf"}
l!l&&r!l&&!r
1112
MC/DC100%2/2
$heredoc or length $main::context->{"buf"}
$heredoc length $main::context->{"buf"}
Truth table100%3/3
A or B
A= $heredocB= length $main::context->{"buf"}
ABresult
1X1
011
000
508 12 my $v = begin_macro( $def, $parametric, @params);
509
510 12 my $do_ml = 1;
511 12 ▶ while ( $do_ml) {
Branch: 1 branch
BranchTrueFalseTotal
if ($do_ml) 18 11 29
512 18 my $l = getline;
513 18 chomp $l;
514 18 ▶ if ( $heredoc) {
Branch: 1 branch
BranchTrueFalseTotal
if ($heredoc) { } 7 11 18
515 7 ▶ last if $l eq $def;
Branch: 1 branch
BranchTrueFalseTotal
if $l eq $def 0 7 7
516 } else {
517 11 $do_ml = $l =~ s/\\\s*$//;
518 }
519 18 ▶ parse_line( $v, $l . ( $do_ml ? "\n" : ''));
Branch: 1 branch
BranchTrueFalseTotal
$do_ml ? : 7 11 18
520 }
521
522 # check if macro already exists by comparing with the macro body
523 11 ▶ my $ref = $parametric ? $macros{$def} : $defines{$def};
Branch: 1 branch
BranchTrueFalseTotal
$parametric ? : 9 2 11
524 11 ▶ if ( defined $ref) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ref) 0 11 11
525 0 my $fail;
526 0 ▶ if ( !defined $ref->{var}) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $ref->{'var'}) { } 0 0 0
527 0 $fail = 1;
528 } else {
529 $fail = (
530 0 join(':', keys %{$ref->{parameters}})
531 ne
532 join(':', @params)
533 ) || (
534 $ref->{var}
535 ne
536 $v->{var}
537 0 ▶ );
Condition0%0/3
join(':', keys %{$$ref{'parameters'};}) ne join(':', @params) || $ref->{'var'} ne $v->{'var'}
l!l&&r!l&&!r
000
MC/DC0%0/2
join(':', keys %{$$ref{'parameters'};}) ne join(':', @params) || $ref->{'var'} ne $v->{'var'}
join(':', keys %{$$ref{'parameters'};}) ne join(':', @params) $ref->{'var'} ne $v->{'var'}
Truth table0%0/3
A || B
A= join(':', keys %{$$ref{'parameters'};}) ne join(':', @params)B= $ref->{'var'} ne $v->{'var'}
ABresult
1X1
011
000
538 }
539 0 ▶ warn "`$def' redefined, previous declaration in $ref->{file}:$ref->{line}\n"
Branch: 1 branch
BranchTrueFalseTotal
if $fail 0 0 0
540 if $fail;
541 }
542
543 # register the macro
544 11 end_macro( $v);
545 } elsif ( $parametric) { # special macro
546 warn "`$def' redefined, previous declaration in $macros{$def}->{file}:$macros{$def}->{line}\n"
547 1 ▶ if exists $macros{$def} and defined $macros{$def}->{var};
Branch: 1 branch
BranchTrueFalseTotal
if exists $main::macros{$def} and defined $main::macros{$def}{"var"} 0 1 1
Condition33%1/3
exists $main::macros{$def} and defined $main::macros{$def}{"var"}
!ll&&!rl&&r
100
MC/DC0%0/2
exists $main::macros{$def} and defined $main::macros{$def}{"var"}
exists $main::macros{$def} defined $main::macros{$def}{"var"}
Truth table33%1/3
A and B
A= exists $main::macros{$def}B= defined $main::macros{$def}{"var"}
ABresult
0X0
100
111
548 $macros{$def} = {
549 name => $def,
550 num => scalar(@params),
551 storage => [],
552 line => $context->{line},
553 file => $context->{file},
554 }
555 1 } else { # special define
556 warn "`$def' redefined, previous declaration in $defines{$def}->{file}:$defines{$def}->{line}\n"
557 1 ▶ if exists $defines{$def} and defined $defines{$def}->{var};
Branch: 1 branch
BranchTrueFalseTotal
if exists $main::defines{$def} and defined $main::defines{$def}{"var"} 0 1 1
Condition33%1/3
exists $main::defines{$def} and defined $main::defines{$def}{"var"}
!ll&&!rl&&r
100
MC/DC0%0/2
exists $main::defines{$def} and defined $main::defines{$def}{"var"}
exists $main::defines{$def} defined $main::defines{$def}{"var"}
Truth table33%1/3
A and B
A= exists $main::defines{$def}B= defined $main::defines{$def}{"var"}
ABresult
0X0
100
111
558 $defines{$def} = {
559 name => $def,
560 num => 0,
561 storage => [],
562 line => $context->{line},
563 file => $context->{file},
564 }
565 1 }
566 } elsif ( $what eq 'undef') {
567 3 my $def = getid();
568 3 delete $defines{$def};
569 3 delete $macros{$def};
570 } elsif ( $what =~ /if(n?)def/) {
571 6 my $def = getid();
572 6 ▶ my $notdef = length($1) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
length $1 ? : 3 3 6
573 6 ▶ push @{$context->{ifdef}}, {
Branch: 2 branches
BranchTrueFalseTotal
exists $main::defines{$def} ? : 2 4 6
exists $main::defines{$def} ? : 2 4 6
574 state => exists($defines{$def}) ? !$notdef : $notdef,
575 flipsleft => 1,
576 passive => [],
577 6 do_else => exists($defines{$def}) ? $notdef : !$notdef,
578 };
579 } elsif ( $what eq 'if') {
580 1 my $do_ml = 1;
581 1 my $v = begin_line;
582 1 ▶ while ( $do_ml) {
Branch: 1 branch
BranchTrueFalseTotal
if ($do_ml) 1 1 2
583 1 my $l = getline;
584 1 chomp $l;
585 1 $do_ml = $l =~ s/\\\s*$//;
586 0 $l =~ s/defined\s*\(([^\)\s]+)\s*\)\s*/is_defined($1)/ge; # XXX a hack
587 1 ▶ parse_line( $v, $l . ( $do_ml ? "\n" : ''));
Branch: 1 branch
BranchTrueFalseTotal
$do_ml ? : 0 1 1
588 }
589 1 my $if = end_line($v);
590 1 my $ret = eval $if;
591 1 ▶ die $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 1 1
592 1 ▶ push @{$context->{ifdef}}, {
Branch: 2 branches
BranchTrueFalseTotal
$ret ? : 1 0 1
$ret ? : 1 0 1
593 state => $ret ? 1 : 0,
594 flipsleft => 1,
595 passive => [],
596 do_else => ( $ret ? 0 : 1),
597 };
598 1 $eatline = 0;
599 } elsif ( $what eq 'elif') {
600 die "Runaway #elif\n" if
601 0 0 == $#{$context->{ifdef}} or
602 0 ▶ @{$context->{ifdef}->[-1]->{passive}};
Branch: 1 branch
BranchTrueFalseTotal
if 0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};} 0 0 0
Condition0%0/3
0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};}
l!l&&r!l&&!r
000
MC/DC0%0/2
0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};}
0 == $#{$$main::context{"ifdef"};} @{$main::context->{"ifdef"}[-1]{"passive"};}
Truth table0%0/3
A or B
A= 0 == $#{$$main::context{"ifdef"};}B= @{$main::context->{"ifdef"}[-1]{"passive"};}
ABresult
1X1
011
000
603 0 my $do_ml = 1;
604 0 my $v = begin_line;
605 0 ▶ while ( $do_ml) {
Branch: 1 branch
BranchTrueFalseTotal
if ($do_ml) 0 0 0
606 0 my $l = getline;
607 0 chomp $l;
608 0 $do_ml = $l =~ s/\\\s*$//;
609 0 $l =~ s/defined\s*\(([^\)\s]+)\s*\)\s*/is_defined($1)/ge; # XXX a hack
610 0 ▶ parse_line( $v, $l . ( $do_ml ? "\n" : ''));
Branch: 1 branch
BranchTrueFalseTotal
$do_ml ? : 0 0 0
611 }
612 0 my $if = end_line($v);
613 0 ▶ if ( $context->{ifdef}->[-1]->{do_else}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($main::context->{'ifdef'}[-1]{'do_else'}) { } 0 0 0
614 0 my $ret = eval $if;
615 0 ▶ die $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 0 0
616 0 ▶ $context->{ifdef}->[-1]->{state} = ($ret ? 1 : 0);
Branch: 1 branch
BranchTrueFalseTotal
$ret ? : 0 0 0
617 0 ▶ $context->{ifdef}->[-1]->{do_else} = 0 if $ret;
Branch: 1 branch
BranchTrueFalseTotal
if $ret 0 0 0
618 } else {
619 0 $context->{ifdef}->[-1]->{state} = 0;
620 }
621 0 $eatline = 0;
622 } elsif ( $what eq 'else') {
623 die "Runaway #else\n" if
624 6 0 == $#{$context->{ifdef}} or
625 6 ▶ @{$context->{ifdef}->[-1]->{passive}};
Branch: 1 branch
BranchTrueFalseTotal
if 0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};} 0 6 6
Condition33%1/3
0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};}
l!l&&r!l&&!r
006
MC/DC0%0/2
0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};}
0 == $#{$$main::context{"ifdef"};} @{$main::context->{"ifdef"}[-1]{"passive"};}
Truth table33%1/3
A or B
A= 0 == $#{$$main::context{"ifdef"};}B= @{$main::context->{"ifdef"}[-1]{"passive"};}
ABresult
1X1
011
000
626 6 ▶ die "Too many #else\n" unless $context->{ifdef}->[-1]->{flipsleft}--;
Branch: 1 branch
BranchTrueFalseTotal
unless $main::context->{"ifdef"}[-1]{"flipsleft"}-- 0 6 6
627 $context->{ifdef}->[-1]->{state} = $context->{ifdef}->[-1]->{state} ?
628 0 :
629 6 ▶ $context->{ifdef}->[-1]->{do_else};
Branch: 1 branch
BranchTrueFalseTotal
$main::context->{'ifdef'}[-1]{'state'} ? : 3 3 6
630 } elsif ( $what eq 'endif') {
631 die "Runaway #endif\n" if
632 7 0 == $#{$context->{ifdef}} or
633 7 ▶ @{$context->{ifdef}->[-1]->{passive}};
Branch: 1 branch
BranchTrueFalseTotal
if 0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};} 0 7 7
Condition33%1/3
0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};}
l!l&&r!l&&!r
007
MC/DC0%0/2
0 == $#{$$main::context{"ifdef"};} or @{$main::context->{"ifdef"}[-1]{"passive"};}
0 == $#{$$main::context{"ifdef"};} @{$main::context->{"ifdef"}[-1]{"passive"};}
Truth table33%1/3
A or B
A= 0 == $#{$$main::context{"ifdef"};}B= @{$main::context->{"ifdef"}[-1]{"passive"};}
ABresult
1X1
011
000
634 7 pop @{$context->{ifdef}};
635 } elsif ( $what eq 'error') {
636 0 die getline;
637 } elsif ( $what eq 'include') {
638 0 my $bracket = gettok();
639 0 ▶ die "format #include <file> or #include \"file\"\n"
Branch: 1 branch
BranchTrueFalseTotal
unless $bracket =~ /^["<]$/ 0 0 0
640 unless $bracket =~ /^["<]$/;
641 0 my $file;
642 my @local_inc;
643 0 ▶ if ( $bracket eq '<') {
Branch: 1 branch
BranchTrueFalseTotal
if ($bracket eq '<') { } 0 0 0
644 0 @local_inc = ( @inc, '.');
645 0 ▶ die "format #include <file>\n" unless $context->{buf} =~ s/([^>]*)>//;
Branch: 1 branch
BranchTrueFalseTotal
unless $main::context->{"buf"} =~ s/([^>]*)>// 0 0 0
646 0 $file = $1;
647 } else {
648 0 @local_inc = ( '.');
649 0 ▶ die "format #include \"file\"\n" unless $context->{buf} =~ s/([^"]*)"//;
Branch: 1 branch
BranchTrueFalseTotal
unless $main::context->{"buf"} =~ s/([^"]*)"// 0 0 0
650 0 $file = $1;
651 }
652 0 my $found;
653 0 for my $inc ( @local_inc) {
654 0 ▶ next unless -f "$inc/$file";
Branch: 1 branch
BranchTrueFalseTotal
unless -f "$inc/$file" 0 0 0
655 0 $found = "$inc/$file";
656 0 last;
657 }
658 0 ▶ die "Cannot find file `$file' in path [@local_inc]\n" unless $found;
Branch: 1 branch
BranchTrueFalseTotal
unless $found 0 0 0
659 0 $file = $found;
660
661 0 local $input;
662 0 ▶ open $input, "< $file" or die "Cannot open $file\n";
Branch: 1 branch
BranchTrueFalseTotal
open $main::input, "< $file" or die "Cannot open $file\n" 0 0 0
663 0 push @context, $context;
664 0 $context = new_context( file => $file);
665 0 parse_file(1);
666 0 $context = pop @context;
667 0 close $input;
668 } elsif ( $what eq 'pragma') {
669 0 my $pragma = gettok();
670 0 ▶ my $param = length($context->{buf}) ? getline() : '';
Branch: 1 branch
BranchTrueFalseTotal
length $main::context->{'buf'} ? : 0 0 0
671 0 $param =~ s/^[\s\(]*(\w+)[\s\)\#]*$/$1/m;
672
673 0 parse_pragma( $pragma, $param);
674 } elsif ( $what eq 'perldef') {
675 5 $eatline = 0;
676 5 my $heredoc = $context->{buf} =~ s/^<<//;
677 5 my $def = getid();
678
679 5 my ( $ellipsis, @params);
680 5 my $parametric = 0;
681 5 ▶ if ( $context->{buf} =~ s/^\(([^\)]*)\)//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($main::context->{"buf"} =~ s/^\(([^\)]*)\)//) 2 3 5
682 2 ▶ if ( $1 eq '...') {
Branch: 1 branch
BranchTrueFalseTotal
if ($1 eq '...') { } 1 1 2
683 1 $ellipsis = 1;
684 } else {
685 @params = map {
686 1 s/^\s*//;
687 2 s/\s*$//;
688 2 ▶ die "`$_' is not a valid Perl scalar declaration (must begin with \$)\n"
Branch: 1 branch
BranchTrueFalseTotal
unless /^\$\w+$/ 0 2 2
689 unless m/^\$\w+$/;
690 2 $_
691 } split ',', $1;
692 }
693 2 $parametric = 1;
694 }
695 5 $context->{buf} =~ s/^\s*//;
696 die "Empty #perldef declaration `$def'\n"
697 5 ▶ unless $heredoc or length $context->{buf};
Branch: 1 branch
BranchTrueFalseTotal
unless $heredoc or length $main::context->{"buf"} 0 5 5
Condition33%1/3
$heredoc or length $main::context->{"buf"}
l!l&&r!l&&!r
050
MC/DC0%0/2
$heredoc or length $main::context->{"buf"}
$heredoc length $main::context->{"buf"}
Truth table33%1/3
A or B
A= $heredocB= length $main::context->{"buf"}
ABresult
1X1
011
000
698
699 5 my $perlcode = "sub {\n";
700 5 ▶ $perlcode .= "my (" . join( ', ', @params) . ") = \@_;\n"
Branch: 1 branch
BranchTrueFalseTotal
if not $ellipsis and @params 1 4 5
Condition100%3/3
not $ellipsis and @params
!ll&&!rl&&r
131
MC/DC100%2/2
not $ellipsis and @params
not $ellipsis @params
Truth table100%3/3
not(A) and B
A= not $ellipsisB= @params
ABresult
0X0
100
111
701 if !$ellipsis and @params;
702
703 5 my $do_ml = 1;
704 5 ▶ while ( $do_ml) {
Branch: 1 branch
BranchTrueFalseTotal
if ($do_ml) 10 5 15
705 10 my $l = getline;
706 10 chomp $l;
707 10 ▶ if ( $heredoc) {
Branch: 1 branch
BranchTrueFalseTotal
if ($heredoc) { } 0 10 10
708 0 ▶ last if $l eq $def;
Branch: 1 branch
BranchTrueFalseTotal
if $l eq $def 0 0 0
709 } else {
710 10 $do_ml = $l =~ s/\\\s*$//;
711 }
712 10 ▶ $perlcode .= $l . ( $do_ml ? "\n" : '');
Branch: 1 branch
BranchTrueFalseTotal
$do_ml ? : 5 5 10
713 }
714 5 $perlcode .= "\n}";
715 5 my $p = eval $perlcode;
716 5 ▶ unless ( defined $p) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $p) 0 5 5
717 0 $@ =~ s/at \(eval \d+\) line (\d+), //gs;
718 0 $@ =~ s/<\$ih>\s+//gs;
719 0 die "$@\n";
720 }
721 5 ▶ ( $parametric ? $macros{$def} : $defines{$def} ) = {
Branch: 1 branch
BranchTrueFalseTotal
$parametric ? : 2 3 5
722 name => $def,
723 num => scalar(@params),
724 storage => [],
725 ellipsis => $ellipsis,
726 code => $p,
727 };
728 } elsif ( $what =~ /^([\w\d_]+)/) {
729 0 die "Invalid preprocessor directive '$1'\n";
730 } else {
731 # a true comment
732 }
733
734 41 ▶ eatline if $eatline;
Branch: 1 branch
BranchTrueFalseTotal
if $eatline 22 19 41
735 }
736
737 sub parse_file
738 1 ▶{
Subroutine parse_file: called CC=8 SCAR=22.9
739 1 my $do_output = $_[0];
740 1 my $l;
741 1 my $h = begin_line;
742 1 ▶ while ( defined ( $l = getline(1))) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($l = getline(1))) 102 0 102
743 102 ▶ if ( !$context->{multiline_comment} and $l =~ s/^#//) {
Branch: 2 branches
BranchTrueFalseTotal
if (not $main::context->{'multiline_comment'} and $l =~ s/^#//) { } 63 39 102
elsif ($main::context->{'ifdef'}[-1]{'state'} and parse_line($h, $l)) { } 33 12 45
Condition66%2/3
not $main::context->{"multiline_comment"} and $l =~ s/^#//
!ll&&!rl&&r
03963
MC/DC50%1/2
not $main::context->{"multiline_comment"} and $l =~ s/^#//
not $main::context->{"multiline_comment"} $l =~ s/^#//
Truth table66%2/3
not(A) and B
A= not $main::context->{"multiline_comment"}B= $l =~ s/^#//
ABresult
0X0
100
111
744 63 $context->{buf} = $l;
745 63 parse_comment( $l);
746 ▶ } elsif ( $context->{ifdef}->[-1]->{state} and parse_line( $h, $l)) {
Condition66%2/3
$main::context->{"ifdef"}[-1]{"state"} and parse_line($h, $l)
!ll&&!rl&&r
6033
MC/DC50%1/2
$main::context->{"ifdef"}[-1]{"state"} and parse_line($h, $l)
$main::context->{"ifdef"}[-1]{"state"} parse_line($h, $l)
Truth table66%2/3
A and B
A= $main::context->{"ifdef"}[-1]{"state"}B= parse_line($h, $l)
ABresult
0X0
100
111
747 33 $l = end_line($h);
748 33 ▶ print $l if $do_output;
Branch: 1 branch
BranchTrueFalseTotal
if $do_output 33 0 33
749 33 begin_line($h);
750 }
751 }
752 0 end_line($h);
753 0 ▶ die "Runaway #ifdef\n" if $#{$context->{ifdef}};
Branch: 1 branch
BranchTrueFalseTotal
if $#{$$main::context{"ifdef"};} 0 0 0
754 }
755
756 sub parse_input
757 1 ▶{
Subroutine parse_input: called CC=5 SCAR=22.3
758 1 my $ih;
759
760 1 ▶ if ( $input eq '-') {
Branch: 2 branches
BranchTrueFalseTotal
if ($main::input eq '-') { } 0 1 1
elsif (not open($ih, "< $main::input")) { } 0 1 1
761 0 $input = \*STDIN;
762 0 $context->{file} = 'stdin';
763 } elsif ( ! open $ih, "< $input") {
764 0 die "Cannot open $input:$!\n";
765 } else {
766 1 $context->{file} = $input;
767 1 $input = $ih;
768 }
769
770 1 ▶ if ( defined $output) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $main::output) 0 1 1
771 0 ▶ open OUT, "> $output" or die "Cannot open $output:$!\n";
Branch: 1 branch
BranchTrueFalseTotal
open OUT, "> $main::output" or die "Cannot open $main::output:$!\n" 0 0 0
772 0 select OUT;
773 }
774 }
775
776 sub parse_argv
777 1 ▶{
Subroutine parse_argv: called CC=30 SCAR=64.1
778 1 my $dominus = 1;
779 1 ▶ for ( my $i = 0; $i < @ARGV; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < @ARGV) 1 1 2
780
781 1 ▶ die "Too many arguments\n" if $input;
Branch: 1 branch
BranchTrueFalseTotal
if $main::input 0 1 1
782
783 1 my $d = $ARGV[$i];
784 1 ▶ if ( $dominus and $d =~ s/^-//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dominus and $d =~ s/^-//) { } 0 1 1
Condition33%1/3
$dominus and $d =~ s/^-//
!ll&&!rl&&r
010
MC/DC0%0/2
$dominus and $d =~ s/^-//
$dominus $d =~ s/^-//
Truth table33%1/3
A and B
A= $dominusB= $d =~ s/^-//
ABresult
0X0
100
111
785 0 ▶ if ( $d =~ /^I(.+)/ or
Branch: 7 branches
BranchTrueFalseTotal
if ($d =~ /^I(.+)/ or $d eq 'I' and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/) { } 0 0 0
elsif ($d =~ /^D(.+)/ or $d eq 'D' and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/) { } 0 0 0
elsif ($d =~ /^o(.+)/ or $d eq 'o' and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/) { } 0 0 0
elsif ($d eq '?' or $d eq 'h' or $d eq '-help') { } 0 0 0
elsif ($d eq 'hh') { } 0 0 0
elsif ($d eq '-') { } 0 0 0
elsif ($d eq '') { } 0 0 0
Condition0%0/11
$d =~ /^I(.+)/ or $d eq "I" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
l!l&&r!l&&!r
000
$d eq "I" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
!ll&&!rl&&r
000
$d eq "I" and defined $ARGV[$i + 1] || die("Argument required\n")
!ll&&!rl&&r
000
defined $ARGV[$i + 1] or die "Argument required\n"
l!l
00
MC/DC0%0/4
$d =~ /^I(.+)/ or $d eq "I" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
$d =~ /^I(.+)/ $d eq "I" defined $ARGV[$i + 1] $ARGV[++$i] =~ /(.*)/
Truth table0%0/5
A or B and C and D
A= $d =~ /^I(.+)/B= $d eq "I"C= defined $ARGV[$i + 1]D= $ARGV[++$i] =~ /(.*)/
ABCDresult
1XXX1
01111
00XX0
010X0
01100
786 ( $d eq 'I' and
787 ( defined $ARGV[$i+1] or die "Argument required\n") and
788 $ARGV[++$i] =~ /(.*)/
789 )) {
790 0 push @inc, $1;
791 ▶ } elsif ( $d =~ /^D(.+)/ or
Condition0%0/11
$d =~ /^D(.+)/ or $d eq "D" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
l!l&&r!l&&!r
000
$d eq "D" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
!ll&&!rl&&r
000
$d eq "D" and defined $ARGV[$i + 1] || die("Argument required\n")
!ll&&!rl&&r
000
defined $ARGV[$i + 1] or die "Argument required\n"
l!l
00
MC/DC0%0/4
$d =~ /^D(.+)/ or $d eq "D" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
$d =~ /^D(.+)/ $d eq "D" defined $ARGV[$i + 1] $ARGV[++$i] =~ /(.*)/
Truth table0%0/5
A or B and C and D
A= $d =~ /^D(.+)/B= $d eq "D"C= defined $ARGV[$i + 1]D= $ARGV[++$i] =~ /(.*)/
ABCDresult
1XXX1
01111
00XX0
010X0
01100
792 ( $d eq 'D' and
793 ( defined $ARGV[$i+1] or die "Argument required\n") and
794 $ARGV[++$i] =~ /(.*)/
795 )) {
796 0 $d = $1;
797 0 ▶ die "Invalid define $d\n" unless $d =~ m/^([^\=]+)(?:\=(.*))?$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $d =~ /^([^\=]+)(?:\=(.*))?$/ 0 0 0
798 0 my ( $def, $body) = ( $1, $2);
799 0 my $v = begin_macro( $def );
800 0 ▶ parse_line( $v, defined($2) ? $2 : '');
Branch: 1 branch
BranchTrueFalseTotal
defined $2 ? : 0 0 0
801 0 end_macro( $v);
802 ▶ } elsif ( $d =~ /^o(.+)/ or
Condition0%0/11
$d =~ /^o(.+)/ or $d eq "o" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
l!l&&r!l&&!r
000
$d eq "o" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
!ll&&!rl&&r
000
$d eq "o" and defined $ARGV[$i + 1] || die("Argument required\n")
!ll&&!rl&&r
000
defined $ARGV[$i + 1] or die "Argument required\n"
l!l
00
MC/DC0%0/4
$d =~ /^o(.+)/ or $d eq "o" and defined $ARGV[$i + 1] || die("Argument required\n") and $ARGV[++$i] =~ /(.*)/
$d =~ /^o(.+)/ $d eq "o" defined $ARGV[$i + 1] $ARGV[++$i] =~ /(.*)/
Truth table0%0/5
A or B and C and D
A= $d =~ /^o(.+)/B= $d eq "o"C= defined $ARGV[$i + 1]D= $ARGV[++$i] =~ /(.*)/
ABCDresult
1XXX1
01111
00XX0
010X0
01100
803 ( $d eq 'o' and
804 ( defined $ARGV[$i+1] or die "Argument required\n") and
805 $ARGV[++$i] =~ /(.*)/
806 )) {
807 0 ▶ die "Output is already defined\n" if defined $output;
Branch: 1 branch
BranchTrueFalseTotal
if defined $main::output 0 0 0
808 0 $output = $1;
809 ▶ } elsif ( $d eq '?' or $d eq 'h' or $d eq '-help') {
Condition0%0/6
$d eq "?" or $d eq "h" or $d eq "-help"
l!l&&r!l&&!r
000
$d eq "?" or $d eq "h"
l!l&&r!l&&!r
000
MC/DC0%0/3
$d eq "?" or $d eq "h" or $d eq "-help"
$d eq "?" $d eq "h" $d eq "-help"
Truth table0%0/4
A or B or C
A= $d eq "?"B= $d eq "h"C= $d eq "-help"
ABCresult
1XX1
01X1
0011
0000
810 0 print <<USAGE;
811 sqlpp - simple SQL preprocessor v$VERSION
812
813 sqlpp [options] filename
814
815 options:
816
817 -I path - include path
818 -D var[=value] - define variable
819 -o output - output to file ( default to stdout )
820 -h,--help - display this text
821 -hh - display man page
822
823 USAGE
824 0 exit;
825 } elsif ( $d eq 'hh') {
826 0 system 'perldoc', $0;
827 0 exit;
828 } elsif ( $d eq '-') {
829 0 $dominus = 0;
830 } elsif ( $d eq '') {
831 0 $input = '-';
832 } else {
833 0 die "Unknown or invalid argument -$d\n";
834 }
835 } else {
836 1 $input = $d;
837 }
838 }
839
840 1 ▶ die "No input file\n" unless defined $input;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $main::input 0 1 1
841 }
842
843 __DATA__
↑ Summary lib/bin/sqlpp.pm »