blib/lib/Zuzu/AST/Visitor/TypeCheckHints.pm

filter: Statementstmt 99.3% 293 / 295 Branchbran 88.3% 152 / 172 Conditioncond 70.2% 97 / 138 MC/DCmcdc 40.0% 32 / 80 Subroutinesub 100% 16 / 16 Podpod 0.0% 0 / 1 totaltotal 84.0% 590 / 702 CC 161 SCAR 44.4
CC
161
Cov
90%
_visit_node
121.7
_expr_static_type
32.2
_visit_function_like
13.6
CRAP 84.9
« blib/lib/Zuzu/Module/TUI.pm ↑ Summary blib/lib/Zuzu/Module/DB.pm »
1 package Zuzu::AST::Visitor::TypeCheckHints;
2  
3 78 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 78 our $VERSION = '0.007002';
6  
7 78 ▶use Scalar::Util qw( blessed );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 78 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 753 ▶has '_scope_stack' => ( is => 'rw', default => sub { [ {} ] } );
Subroutine __ANON__: called CC=1 SCAR=0.0
12 753 ▶has '_return_type_stack' => ( is => 'rw', default => sub { [] } );
Subroutine __ANON__: called CC=1 SCAR=0.0
13  
14 753 ▶sub apply {
Subroutine apply: called CC=1 SCAR=0.0
Pod undocumented
15 753 my ( $self, $ast ) = @_;
16  
17 753 $self->_visit_node($ast);
18  
19 753 return $ast;
20 }
21  
22 11705 ▶sub _current_scope {
Subroutine _current_scope: called CC=1 SCAR=0.0
23 11705 my ( $self ) = @_;
24  
25 11705 return $self->_scope_stack->[-1];
26 }
27  
28 9695 ▶sub _push_scope {
Subroutine _push_scope: called CC=1 SCAR=0.0
29 9695 my ( $self ) = @_;
30  
31 9695 push @{ $self->_scope_stack }, {};
32  
33 9695 return;
34 }
35  
36 9695 ▶sub _pop_scope {
Subroutine _pop_scope: called CC=1 SCAR=0.0
37 9695 my ( $self ) = @_;
38  
39 9695 pop @{ $self->_scope_stack };
40  
41 9695 return;
42 }
43  
44 11705 ▶sub _declare_typed_name {
Subroutine _declare_typed_name: called CC=3 SCAR=11.3
45 11705 my ( $self, $name, $declared_type ) = @_;
46  
47 11705 ▶ return if !defined $name;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $name 0 11705 11705
48 11705 ▶ $declared_type //= 'Any';
Condition50%1/2
$declared_type //= "Any"
l!l
117050
MC/DC0%0/1
$declared_type //= "Any"
$declared_type
Truth table50%1/2
A
A= $declared_type
Aresult
11
00
49  
50 11705 $self->_current_scope->{ $name } = $declared_type;
51  
52 11705 return;
53 }
54  
55 11819 ▶sub _lookup_declared_type {
Subroutine _lookup_declared_type: called CC=4 SCAR=13.9
56 11819 my ( $self, $name ) = @_;
57  
58 11819 ▶ return 'Any' if !defined $name;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $name 0 11819 11819
59  
60 11819 ▶ for ( my $i = $#{ $self->_scope_stack }; $i >= 0; $i-- ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i >= 0) 21919 923 22842
61 21919 my $scope = $self->_scope_stack->[$i];
62 21919 ▶ return $scope->{ $name } if exists $scope->{ $name };
Branch: 1 branch
BranchTrueFalseTotal
if exists $scope->{$name} 10896 11023 21919
63 }
64  
65 923 return 'Any';
66 }
67  
68 5244 ▶sub _visit_block_with_scope {
Subroutine _visit_block_with_scope: called CC=2 SCAR=7.0
69 5244 my ( $self, $block ) = @_;
70  
71 5244 ▶ return if !defined $block;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $block 0 5244 5244
72  
73 5244 $self->_push_scope;
74 5244 $self->_visit_node($block);
75 5244 $self->_pop_scope;
76  
77 5244 return;
78 }
79  
80 3557 ▶sub _visit_function_like {
Subroutine _visit_function_like: called CC=13 SCAR=26.1
81 3557 my ( $self, $node ) = @_;
82  
83 3557 $self->_push_scope;
84  
85 3557 ▶ for my $name ( @{ $node->params // [] } ) {
Condition50%1/2
$node->params // []
l!l
35570
MC/DC0%0/1
$node->params // []
$node->params
Truth table50%1/2
A
A= $node->params
Aresult
11
00
86 4997 ▶ my $declared_type = $node->param_types->{$name} // 'Any';
Condition50%1/2
$node->param_types->{$name} // "Any"
l!l
49970
MC/DC0%0/1
$node->param_types->{$name} // "Any"
$node->param_types->{$name}
Truth table50%1/2
A
A= $node->param_types->{$name}
Aresult
11
00
87 4997 $self->_declare_typed_name( $name, $declared_type );
88 }
89 3557 ▶ if ( defined $node->vararg ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $node->vararg) 62 3495 3557
90 62 ▶ my $declared_type = $node->vararg_type // 'Any';
Condition50%1/2
$node->vararg_type // "Any"
l!l
620
MC/DC0%0/1
$node->vararg_type // "Any"
$node->vararg_type
Truth table50%1/2
A
A= $node->vararg_type
Aresult
11
00
91 62 $self->_declare_typed_name( $node->vararg, $declared_type );
92 }
93  
94 3557 ▶ for my $name ( sort keys %{ $node->param_defaults // {} } ) {
Condition50%1/2
$node->param_defaults // {}
l!l
35570
MC/DC0%0/1
$node->param_defaults // {}
$node->param_defaults
Truth table50%1/2
A
A= $node->param_defaults
Aresult
11
00
95 174 my $default_expr = $node->param_defaults->{$name};
96 174 $self->_visit_node($default_expr);
97 174 ▶ my $declared_type = $node->param_types->{$name} // 'Any';
Condition50%1/2
$node->param_types->{$name} // "Any"
l!l
1740
MC/DC0%0/1
$node->param_types->{$name} // "Any"
$node->param_types->{$name}
Truth table50%1/2
A
A= $node->param_types->{$name}
Aresult
11
00
98 174 ▶ if ( $self->_expr_matches_type( $default_expr, $declared_type ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->_expr_matches_type($default_expr, $declared_type)) 174 0 174
99 174 $node->{_default_typecheck_safe}{$name} = 1;
100 }
101 }
102  
103 3557 ▶ if ( $node->can('is_predeclared') and $node->is_predeclared ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->can("is_predeclared") and $node->is_predeclared) 41 3516 3557
Condition100%3/3
$node->can("is_predeclared") and $node->is_predeclared
!ll&&!rl&&r
458305841
MC/DC100%2/2
$node->can("is_predeclared") and $node->is_predeclared
$node->can("is_predeclared") $node->is_predeclared
Truth table100%3/3
A and B
A= $node->can("is_predeclared")B= $node->is_predeclared
ABresult
0X0
100
111
104 41 $self->_pop_scope;
105 41 return;
106 }
107  
108 3516 ▶ push @{ $self->_return_type_stack }, ( $node->return_type // 'Any' );
Condition50%1/2
$node->return_type // "Any"
l!l
35160
MC/DC0%0/1
$node->return_type // "Any"
$node->return_type
Truth table50%1/2
A
A= $node->return_type
Aresult
11
00
109 3516 $self->_visit_node( $node->body );
110 3516 pop @{ $self->_return_type_stack };
111 3516 $self->_pop_scope;
112  
113 3516 return;
114 }
115  
116 144164 ▶sub _visit_node {
Subroutine _visit_node: called CC=114 SCAR=48.0
117 144164 my ( $self, $node ) = @_;
118  
119 144164 ▶ return if !defined $node;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $node 119 144045 144164
120 144045 ▶ return if !blessed($node);
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($node) 0 144045 144045
121  
122 144045 ▶ if ( $node->isa('Zuzu::AST::Program') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Program")) 753 143292 144045
123 753 ▶ for my $stmt ( @{ $node->statements // [] } ) {
Condition50%1/2
$node->statements // []
l!l
7530
MC/DC0%0/1
$node->statements // []
$node->statements
Truth table50%1/2
A
A= $node->statements
Aresult
11
00
124 3910 $self->_visit_node($stmt);
125 }
126 753 return;
127 }
128  
129 143292 ▶ if ( $node->isa('Zuzu::AST::Block') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Block")) 9330 133962 143292
130 9330 ▶ for my $stmt ( @{ $node->statements // [] } ) {
Condition50%1/2
$node->statements // []
l!l
93300
MC/DC0%0/1
$node->statements // []
$node->statements
Truth table50%1/2
A
A= $node->statements
Aresult
11
00
131 22076 $self->_visit_node($stmt);
132 }
133 9330 return;
134 }
135  
136 133962 ▶ if ( $node->isa('Zuzu::AST::Stmt::Let') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Let")) 5727 128235 133962
137 5727 ▶ $self->_visit_node( $node->init ) if defined $node->init;
Branch: 1 branch
BranchTrueFalseTotal
if defined $node->init 5676 51 5727
138 5727 ▶ my $declared_type = $node->declared_type // 'Any';
Condition50%1/2
$node->declared_type // "Any"
l!l
57270
MC/DC0%0/1
$node->declared_type // "Any"
$node->declared_type
Truth table50%1/2
A
A= $node->declared_type
Aresult
11
00
139 5727 ▶ if ( defined $node->init and $declared_type ne 'Any' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $node->init and $declared_type ne "Any") 14 5713 5727
Condition100%3/3
defined $node->init and $declared_type ne "Any"
!ll&&!rl&&r
51566214
MC/DC100%2/2
defined $node->init and $declared_type ne "Any"
defined $node->init $declared_type ne "Any"
Truth table100%3/3
A and B
A= defined $node->initB= $declared_type ne "Any"
ABresult
0X0
100
111
140 14 ▶ if ( $self->_expr_matches_type( $node->init, $declared_type ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->_expr_matches_type($node->init, $declared_type)) 11 3 14
141 11 $node->{_skip_type_check} = 1;
142 }
143 }
144 5727 $self->_declare_typed_name( $node->name, $declared_type );
145 5727 return;
146 }
147  
148 128235 ▶ if ( $node->isa('Zuzu::AST::Stmt::LetUnpack') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::LetUnpack")) 18 128217 128235
149 18 ▶ for my $binding ( @{ $node->bindings // [] } ) {
Condition50%1/2
$node->bindings // []
l!l
180
MC/DC0%0/1
$node->bindings // []
$node->bindings
Truth table50%1/2
A
A= $node->bindings
Aresult
11
00
150 27 $self->_visit_node( $binding->{key_expr} );
151 $self->_visit_node( $binding->{default_expr} )
152 27 ▶ if $binding->{has_default};
Branch: 1 branch
BranchTrueFalseTotal
if $binding->{"has_default"} 4 23 27
153 }
154 18 ▶ $self->_visit_node( $node->init ) if defined $node->init;
Branch: 1 branch
BranchTrueFalseTotal
if defined $node->init 18 0 18
155 18 ▶ for my $binding ( @{ $node->bindings // [] } ) {
Condition50%1/2
$node->bindings // []
l!l
180
MC/DC0%0/1
$node->bindings // []
$node->bindings
Truth table50%1/2
A
A= $node->bindings
Aresult
11
00
156 $self->_declare_typed_name(
157 $binding->{name},
158 27 ▶ $binding->{declared_type} // 'Any',
Condition50%1/2
$binding->{"declared_type"} // "Any"
l!l
270
MC/DC0%0/1
$binding->{"declared_type"} // "Any"
$binding->{"declared_type"}
Truth table50%1/2
A
A= $binding->{"declared_type"}
Aresult
11
00
159 );
160 }
161 18 return;
162 }
163  
164 128217 ▶ if ( $node->isa('Zuzu::AST::Stmt::Assign') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Assign")) 2195 126022 128217
165 2195 $self->_visit_node( $node->target );
166 2195 $self->_visit_node( $node->expr );
167 2195 ▶ if ( $node->op eq ':=' and blessed( $node->target ) and $node->target->isa('Zuzu::AST::Expr::Var') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->op eq ":=" and builtin::blessed($node->target) and $node->target->isa("Zuzu::AST::Expr::Var")) 1344 851 2195
Condition83%5/6
$node->op eq ":=" and builtin::blessed($node->target) and $node->target->isa("Zuzu::AST::Expr::Var")
!ll&&!rl&&r
6292221344
$node->op eq ":=" and builtin::blessed($node->target)
!ll&&!rl&&r
62901566
MC/DC66%2/3
$node->op eq ":=" and builtin::blessed($node->target) and $node->target->isa("Zuzu::AST::Expr::Var")
$node->op eq ":=" builtin::blessed($node->target) $node->target->isa("Zuzu::AST::Expr::Var")
Truth table75%3/4
A and B and C
A= $node->op eq ":="B= builtin::blessed($node->target)C= $node->target->isa("Zuzu::AST::Expr::Var")
ABCresult
0XX0
10X0
1100
1111
168 1344 my $name = $node->target->name;
169 1344 my $declared_type = $self->_lookup_declared_type($name);
170 1344 ▶ if ( $declared_type ne 'Any' and $self->_expr_matches_type( $node->expr, $declared_type ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($declared_type ne "Any" and $self->_expr_matches_type($node->expr, $declared_type)) 8 1336 1344
Condition100%3/3
$declared_type ne "Any" and $self->_expr_matches_type($node->expr, $declared_type)
!ll&&!rl&&r
132978
MC/DC100%2/2
$declared_type ne "Any" and $self->_expr_matches_type($node->expr, $declared_type)
$declared_type ne "Any" $self->_expr_matches_type($node->expr, $declared_type)
Truth table100%3/3
A and B
A= $declared_type ne "Any"B= $self->_expr_matches_type($node->expr, $declared_type)
ABresult
0X0
100
111
171 8 $node->{_skip_type_check} = 1;
172 }
173 }
174 2195 return;
175 }
176  
177 126022 ▶ if ( $node->isa('Zuzu::AST::Stmt::Expr') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Expr")) 4071 121951 126022
178 4071 $self->_visit_node( $node->expr );
179 4071 return;
180 }
181  
182 121951 ▶ if ( $node->isa('Zuzu::AST::Stmt::Return') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Return")) 5320 116631 121951
183 5320 ▶ $self->_visit_node( $node->expr ) if $node->can('expr');
Branch: 1 branch
BranchTrueFalseTotal
if $node->can("expr") 5320 0 5320
184 5320 ▶ if ( @{ $self->_return_type_stack } and defined $node->expr ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@{$self->_return_type_stack;} and defined $node->expr) 5208 112 5320
Condition66%2/3
@{$self->_return_type_stack;} and defined $node->expr
!ll&&!rl&&r
01125208
MC/DC50%1/2
@{$self->_return_type_stack;} and defined $node->expr
@{$self->_return_type_stack;} defined $node->expr
Truth table66%2/3
A and B
A= @{$self->_return_type_stack;}B= defined $node->expr
ABresult
0X0
100
111
185 5208 ▶ my $declared_return_type = $self->_return_type_stack->[-1] // 'Any';
Condition50%1/2
$self->_return_type_stack->[-1] // "Any"
l!l
52080
MC/DC0%0/1
$self->_return_type_stack->[-1] // "Any"
$self->_return_type_stack->[-1]
Truth table50%1/2
A
A= $self->_return_type_stack->[-1]
Aresult
11
00
186 5208 ▶ if ( $declared_return_type ne 'Any' and $self->_expr_matches_type( $node->expr, $declared_return_type ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($declared_return_type ne "Any" and $self->_expr_matches_type($node->expr, $declared_return_type)) 8 5200 5208
Condition100%3/3
$declared_return_type ne "Any" and $self->_expr_matches_type($node->expr, $declared_return_type)
!ll&&!rl&&r
5155458
MC/DC100%2/2
$declared_return_type ne "Any" and $self->_expr_matches_type($node->expr, $declared_return_type)
$declared_return_type ne "Any" $self->_expr_matches_type($node->expr, $declared_return_type)
Truth table100%3/3
A and B
A= $declared_return_type ne "Any"B= $self->_expr_matches_type($node->expr, $declared_return_type)
ABresult
0X0
100
111
187 8 $node->{_skip_type_check} = 1;
188 }
189 }
190 5320 return;
191 }
192  
193 116631 ▶ if ( $node->isa('Zuzu::AST::Stmt::If') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::If")) 3860 112771 116631
194 3860 $self->_visit_node( $node->cond );
195 3860 $self->_visit_block_with_scope( $node->then_block );
196 3860 ▶ $self->_visit_block_with_scope( $node->else_branch ) if defined $node->else_branch;
Branch: 1 branch
BranchTrueFalseTotal
if defined $node->else_branch 597 3263 3860
197 3860 return;
198 }
199  
200 112771 ▶ if ( $node->isa('Zuzu::AST::Stmt::PostfixIf') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::PostfixIf")) 1205 111566 112771
201 1205 $self->_visit_node( $node->cond );
202 1205 $self->_visit_node( $node->statement );
203 1205 return;
204 }
205  
206 111566 ▶ if ( $node->isa('Zuzu::AST::Stmt::While') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::While")) 496 111070 111566
207 496 $self->_visit_node( $node->cond );
208 496 $self->_visit_block_with_scope( $node->body );
209 496 return;
210 }
211  
212 111070 ▶ if ( $node->isa('Zuzu::AST::Stmt::For') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::For")) 740 110330 111070
213 740 $self->_visit_node( $node->collection );
214 740 $self->_push_scope;
215 740 ▶ if ( $node->declare_loop_var ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->declare_loop_var) 738 2 740
216 738 $self->_declare_typed_name( $node->var, 'Any' );
217 }
218 740 $self->_visit_node( $node->body );
219 740 $self->_pop_scope;
220 740 ▶ $self->_visit_block_with_scope( $node->else_block ) if defined $node->else_block;
Branch: 1 branch
BranchTrueFalseTotal
if defined $node->else_block 15 725 740
221 740 return;
222 }
223  
224 110330 ▶ if ( $node->isa('Zuzu::AST::Stmt::Function') or $node->isa('Zuzu::AST::Expr::Function') or $node->isa('Zuzu::AST::Stmt::Method') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Function") or $node->isa("Zuzu::AST::Expr::Function") or $node->isa("Zuzu::AST::Stmt::Method")) 3557 106773 110330
Condition100%6/6
$node->isa("Zuzu::AST::Stmt::Function") or $node->isa("Zuzu::AST::Expr::Function") or $node->isa("Zuzu::AST::Stmt::Method")
l!l&&r!l&&!r
19601597106773
$node->isa("Zuzu::AST::Stmt::Function") or $node->isa("Zuzu::AST::Expr::Function")
l!l&&r!l&&!r
1502458108370
MC/DC100%3/3
$node->isa("Zuzu::AST::Stmt::Function") or $node->isa("Zuzu::AST::Expr::Function") or $node->isa("Zuzu::AST::Stmt::Method")
$node->isa("Zuzu::AST::Stmt::Function") $node->isa("Zuzu::AST::Expr::Function") $node->isa("Zuzu::AST::Stmt::Method")
Truth table100%4/4
A or B or C
A= $node->isa("Zuzu::AST::Stmt::Function")B= $node->isa("Zuzu::AST::Expr::Function")C= $node->isa("Zuzu::AST::Stmt::Method")
ABCresult
1XX1
01X1
0011
0000
225 3557 $self->_visit_function_like($node);
226 3557 return;
227 }
228  
229 106773 ▶ if ( $node->isa('Zuzu::AST::Stmt::Class') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Class")) 302 106471 106773
230 302 ▶ $self->_visit_node( $node->parent ) if defined $node->parent;
Branch: 1 branch
BranchTrueFalseTotal
if defined $node->parent 133 169 302
231 302 ▶ for my $trait_ref ( @{ $node->traits // [] } ) {
Condition50%1/2
$node->traits // []
l!l
3020
MC/DC0%0/1
$node->traits // []
$node->traits
Truth table50%1/2
A
A= $node->traits
Aresult
11
00
232 20 $self->_visit_node($trait_ref);
233 }
234 302 ▶ for my $field ( @{ $node->fields // [] } ) {
Condition50%1/2
$node->fields // []
l!l
3020
MC/DC0%0/1
$node->fields // []
$node->fields
Truth table50%1/2
A
A= $node->fields
Aresult
11
00
235 468 ▶ next if !defined $field->{init};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $field->{"init"} 92 376 468
236 376 $self->_visit_node( $field->{init} );
237 }
238 302 ▶ for my $method ( @{ $node->methods // [] } ) {
Condition50%1/2
$node->methods // []
l!l
3020
MC/DC0%0/1
$node->methods // []
$node->methods
Truth table50%1/2
A
A= $node->methods
Aresult
11
00
239 1492 $self->_visit_node($method);
240 }
241 302 ▶ for my $method ( @{ $node->static_methods // [] } ) {
Condition50%1/2
$node->static_methods // []
l!l
3020
MC/DC0%0/1
$node->static_methods // []
$node->static_methods
Truth table50%1/2
A
A= $node->static_methods
Aresult
11
00
242 73 $self->_visit_node($method);
243 }
244 302 ▶ for my $klass ( @{ $node->classes // [] } ) {
Condition50%1/2
$node->classes // []
l!l
3020
MC/DC0%0/1
$node->classes // []
$node->classes
Truth table50%1/2
A
A= $node->classes
Aresult
11
00
245 0 $self->_visit_node($klass);
246 }
247 302 return;
248 }
249  
250 106471 ▶ if ( $node->isa('Zuzu::AST::Stmt::Trait') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Trait")) 14 106457 106471
251 14 ▶ for my $method ( @{ $node->methods // [] } ) {
Condition50%1/2
$node->methods // []
l!l
140
MC/DC0%0/1
$node->methods // []
$node->methods
Truth table50%1/2
A
A= $node->methods
Aresult
11
00
252 32 $self->_visit_node($method);
253 }
254 14 return;
255 }
256  
257 106457 ▶ if ( $node->isa('Zuzu::AST::Stmt::Try') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Try")) 152 106305 106457
258 152 $self->_visit_block_with_scope( $node->block );
259 152 ▶ for my $catch ( @{ $node->catches // [] } ) {
Condition50%1/2
$node->catches // []
l!l
1520
MC/DC0%0/1
$node->catches // []
$node->catches
Truth table50%1/2
A
A= $node->catches
Aresult
11
00
260 154 $self->_visit_node($catch);
261 }
262 152 return;
263 }
264  
265 106305 ▶ if ( $node->isa('Zuzu::AST::Stmt::Catch') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Stmt::Catch")) 154 106151 106305
266 154 $self->_visit_node( $node->type_expr );
267 154 $self->_push_scope;
268 154 $self->_declare_typed_name( $node->name, 'Any' );
269 154 $self->_visit_node( $node->block );
270 154 $self->_pop_scope;
271 154 return;
272 }
273  
274 106151 ▶ if ( $node->isa('Zuzu::AST::Expr::Call') or $node->isa('Zuzu::AST::Expr::MemberCall') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Call") or $node->isa("Zuzu::AST::Expr::MemberCall")) 14758 91393 106151
Condition100%3/3
$node->isa("Zuzu::AST::Expr::Call") or $node->isa("Zuzu::AST::Expr::MemberCall")
l!l&&r!l&&!r
6682807691393
MC/DC100%2/2
$node->isa("Zuzu::AST::Expr::Call") or $node->isa("Zuzu::AST::Expr::MemberCall")
$node->isa("Zuzu::AST::Expr::Call") $node->isa("Zuzu::AST::Expr::MemberCall")
Truth table100%3/3
A or B
A= $node->isa("Zuzu::AST::Expr::Call")B= $node->isa("Zuzu::AST::Expr::MemberCall")
ABresult
1X1
011
000
275 14758 ▶ $self->_visit_node( $node->callee ) if $node->can('callee');
Branch: 1 branch
BranchTrueFalseTotal
if $node->can("callee") 6682 8076 14758
276 14758 ▶ $self->_visit_node( $node->object ) if $node->can('object');
Branch: 1 branch
BranchTrueFalseTotal
if $node->can("object") 8076 6682 14758
277 14758 my @arg_types;
278 14758 ▶ for my $arg ( @{ $node->args // [] } ) {
Condition50%1/2
$node->args // []
l!l
147580
MC/DC0%0/1
$node->args // []
$node->args
Truth table50%1/2
A
A= $node->args
Aresult
11
00
279 21109 ▶ my $expr = ref($arg) eq 'ARRAY' ? $arg->[1] : $arg;
Branch: 1 branch
BranchTrueFalseTotal
ref $arg eq 'ARRAY' ? : 20948 161 21109
280 21109 ▶ if ( ref($arg) eq 'ARRAY' and $arg->[2] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $arg eq "ARRAY" and $arg->[2]) 5 21104 21109
Condition100%3/3
ref $arg eq "ARRAY" and $arg->[2]
!ll&&!rl&&r
161209435
MC/DC100%2/2
ref $arg eq "ARRAY" and $arg->[2]
ref $arg eq "ARRAY" $arg->[2]
Truth table100%3/3
A and B
A= ref $arg eq "ARRAY"B= $arg->[2]
ABresult
0X0
100
111
281 5 $self->_visit_node( $arg->[0] );
282 }
283 21109 $self->_visit_node($expr);
284 21109 ▶ next if blessed($expr) and $expr->isa('Zuzu::AST::Expr::Spread');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($expr) and $expr->isa("Zuzu::AST::Expr::Spread") 15 21094 21109
Condition66%2/3
builtin::blessed($expr) and $expr->isa("Zuzu::AST::Expr::Spread")
!ll&&!rl&&r
02109415
MC/DC50%1/2
builtin::blessed($expr) and $expr->isa("Zuzu::AST::Expr::Spread")
builtin::blessed($expr) $expr->isa("Zuzu::AST::Expr::Spread")
Truth table66%2/3
A and B
A= builtin::blessed($expr)B= $expr->isa("Zuzu::AST::Expr::Spread")
ABresult
0X0
100
111
285 21094 ▶ push @arg_types, $self->_expr_static_type($expr)
Branch: 1 branch
BranchTrueFalseTotal
if ref $arg ne "ARRAY" or not defined $arg->[0] 20920 174 21094
Condition100%3/3
ref $arg ne "ARRAY" or not defined $arg->[0]
l!l&&r!l&&!r
16120759174
MC/DC100%2/2
ref $arg ne "ARRAY" or not defined $arg->[0]
ref $arg ne "ARRAY" not defined $arg->[0]
Truth table100%3/3
A or not(B)
A= ref $arg ne "ARRAY"B= not defined $arg->[0]
ABresult
1X1
011
000
286 if ref($arg) ne 'ARRAY' or !defined $arg->[0];
287 }
288 14758 $node->{_arg_static_types} = \@arg_types;
289 14758 return;
290 }
291  
292 91393 ▶ if ( $node->isa('Zuzu::AST::Expr::DynamicMemberCall') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::DynamicMemberCall")) 11 91382 91393
293 11 $self->_visit_node( $node->object );
294 11 $self->_visit_node( $node->method_expr );
295 11 ▶ for my $arg ( @{ $node->args // [] } ) {
Condition50%1/2
$node->args // []
l!l
110
MC/DC0%0/1
$node->args // []
$node->args
Truth table50%1/2
A
A= $node->args
Aresult
11
00
296 7 ▶ my $expr = ref($arg) eq 'ARRAY' ? $arg->[1] : $arg;
Branch: 1 branch
BranchTrueFalseTotal
ref $arg eq 'ARRAY' ? : 7 0 7
297 7 ▶ if ( ref($arg) eq 'ARRAY' and $arg->[2] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $arg eq "ARRAY" and $arg->[2]) 0 7 7
Condition33%1/3
ref $arg eq "ARRAY" and $arg->[2]
!ll&&!rl&&r
070
MC/DC0%0/2
ref $arg eq "ARRAY" and $arg->[2]
ref $arg eq "ARRAY" $arg->[2]
Truth table33%1/3
A and B
A= ref $arg eq "ARRAY"B= $arg->[2]
ABresult
0X0
100
111
298 0 $self->_visit_node( $arg->[0] );
299 }
300 7 $self->_visit_node($expr);
301 }
302 11 return;
303 }
304  
305 91382 ▶ if ( $node->isa('Zuzu::AST::Expr::Spread') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Spread")) 19 91363 91382
306 19 $self->_visit_node( $node->expr );
307 19 return;
308 }
309  
310 91363 ▶ if ( $node->isa('Zuzu::AST::Expr::Binary') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Binary")) 11111 80252 91363
311 11111 $self->_visit_node( $node->left );
312 11111 $self->_visit_node( $node->right );
313 11111 return;
314 }
315  
316 80252 ▶ if ( $node->isa('Zuzu::AST::Expr::Unary') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Unary")) 1798 78454 80252
317 1798 $self->_visit_node( $node->expr );
318 1798 return;
319 }
320  
321 78454 ▶ if ( $node->isa('Zuzu::AST::Expr::Await') or $node->isa('Zuzu::AST::Expr::Spawn') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Await") or $node->isa("Zuzu::AST::Expr::Spawn")) 124 78330 78454
Condition100%3/3
$node->isa("Zuzu::AST::Expr::Await") or $node->isa("Zuzu::AST::Expr::Spawn")
l!l&&r!l&&!r
1071778330
MC/DC100%2/2
$node->isa("Zuzu::AST::Expr::Await") or $node->isa("Zuzu::AST::Expr::Spawn")
$node->isa("Zuzu::AST::Expr::Await") $node->isa("Zuzu::AST::Expr::Spawn")
Truth table100%3/3
A or B
A= $node->isa("Zuzu::AST::Expr::Await")B= $node->isa("Zuzu::AST::Expr::Spawn")
ABresult
1X1
011
000
322 124 $self->_visit_block_with_scope( $node->block );
323 124 return;
324 }
325  
326 78330 ▶ if ( $node->isa('Zuzu::AST::Expr::Ternary') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Ternary")) 596 77734 78330
327 596 $self->_visit_node( $node->cond );
328 596 ▶ $self->_visit_node( $node->if_true ) if defined $node->if_true;
Branch: 1 branch
BranchTrueFalseTotal
if defined $node->if_true 573 23 596
329 596 $self->_visit_node( $node->if_false );
330 596 return;
331 }
332  
333 77734 ▶ if ( $node->isa('Zuzu::AST::Expr::Index') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Index")) 1095 76639 77734
334 1095 $self->_visit_node( $node->array );
335 1095 $self->_visit_node( $node->index );
336 1095 return;
337 }
338  
339 76639 ▶ if ( $node->isa('Zuzu::AST::Expr::DictGet') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::DictGet")) 2433 74206 76639
340 2433 $self->_visit_node( $node->dict );
341 2433 $self->_visit_node( $node->key );
342 2433 return;
343 }
344  
345 74206 ▶ if ( $node->isa('Zuzu::AST::Expr::Slice') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Slice")) 23 74183 74206
346 23 $self->_visit_node( $node->collection );
347 23 ▶ $self->_visit_node( $node->start ) if defined $node->start;
Branch: 1 branch
BranchTrueFalseTotal
if defined $node->start 23 0 23
348 23 ▶ $self->_visit_node( $node->length ) if defined $node->length;
Branch: 1 branch
BranchTrueFalseTotal
if defined $node->length 15 8 23
349 23 return;
350 }
351  
352 74183 ▶ if ( $node->isa('Zuzu::AST::Expr::IncDec') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::IncDec")) 690 73493 74183
353 690 $self->_visit_node( $node->target );
354 690 return;
355 }
356  
357 73493 ▶ if ( $node->isa('Zuzu::AST::Expr::Array') or $node->isa('Zuzu::AST::Expr::Set') or $node->isa('Zuzu::AST::Expr::Bag') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Array") or $node->isa("Zuzu::AST::Expr::Set") or $node->isa("Zuzu::AST::Expr::Bag")) 1228 72265 73493
Condition100%6/6
$node->isa("Zuzu::AST::Expr::Array") or $node->isa("Zuzu::AST::Expr::Set") or $node->isa("Zuzu::AST::Expr::Bag")
l!l&&r!l&&!r
11903872265
$node->isa("Zuzu::AST::Expr::Array") or $node->isa("Zuzu::AST::Expr::Set")
l!l&&r!l&&!r
11335772303
MC/DC100%3/3
$node->isa("Zuzu::AST::Expr::Array") or $node->isa("Zuzu::AST::Expr::Set") or $node->isa("Zuzu::AST::Expr::Bag")
$node->isa("Zuzu::AST::Expr::Array") $node->isa("Zuzu::AST::Expr::Set") $node->isa("Zuzu::AST::Expr::Bag")
Truth table100%4/4
A or B or C
A= $node->isa("Zuzu::AST::Expr::Array")B= $node->isa("Zuzu::AST::Expr::Set")C= $node->isa("Zuzu::AST::Expr::Bag")
ABCresult
1XX1
01X1
0011
0000
358 1228 ▶ for my $item ( @{ $node->items // [] } ) {
Condition50%1/2
$node->items // []
l!l
12280
MC/DC0%0/1
$node->items // []
$node->items
Truth table50%1/2
A
A= $node->items
Aresult
11
00
359 1723 $self->_visit_node($item);
360 }
361 1228 return;
362 }
363 72265 ▶ if ( $node->isa('Zuzu::AST::Expr::Range') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Range")) 10 72255 72265
364 10 $self->_visit_node( $node->start );
365 10 $self->_visit_node( $node->end );
366 10 return;
367 }
368  
369 72255 ▶ if ( $node->isa('Zuzu::AST::Expr::Dict') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::Dict")) 814 71441 72255
370 814 ▶ for my $pair ( @{ $node->pairs // [] } ) {
Condition50%1/2
$node->pairs // []
l!l
8140
MC/DC0%0/1
$node->pairs // []
$node->pairs
Truth table50%1/2
A
A= $node->pairs
Aresult
11
00
371 2231 ▶ next if ref($pair) ne 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
if ref $pair ne "ARRAY" 0 2231 2231
372 2231 $self->_visit_node( $pair->[0] );
373 2231 $self->_visit_node( $pair->[1] );
374 }
375 814 return;
376 }
377  
378 71441 ▶ if ( $node->isa('Zuzu::AST::Expr::New') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->isa("Zuzu::AST::Expr::New")) 755 70686 71441
379 755 $self->_visit_node( $node->class_expr );
380 755 ▶ for my $trait_ref ( @{ $node->traits // [] } ) {
Condition50%1/2
$node->traits // []
l!l
7550
MC/DC0%0/1
$node->traits // []
$node->traits
Truth table50%1/2
A
A= $node->traits
Aresult
11
00
381 3 $self->_visit_node( $trait_ref );
382 }
383 755 ▶ for my $pair ( @{ $node->args // [] } ) {
Condition50%1/2
$node->args // []
l!l
7550
MC/DC0%0/1
$node->args // []
$node->args
Truth table50%1/2
A
A= $node->args
Aresult
11
00
384 1676 $self->_visit_node( $pair->[1] );
385 }
386 755 return;
387 }
388  
389 70686 return;
390 }
391  
392 256 ▶sub _expr_matches_type {
Subroutine _expr_matches_type: called CC=5 SCAR=16.1
393 256 my ( $self, $expr, $target_type ) = @_;
394  
395 256 ▶ return 1 if !defined $target_type or $target_type eq 'Any';
Branch: 1 branch
BranchTrueFalseTotal
if not defined $target_type or $target_type eq "Any" 119 137 256
Condition66%2/3
not defined $target_type or $target_type eq "Any"
l!l&&r!l&&!r
0119137
MC/DC50%1/2
not defined $target_type or $target_type eq "Any"
not defined $target_type $target_type eq "Any"
Truth table66%2/3
not(A) or B
A= not defined $target_typeB= $target_type eq "Any"
ABresult
1X1
011
000
396  
397 137 my $expr_type = $self->_expr_static_type($expr);
398 137 ▶ return 0 if !defined $expr_type;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $expr_type 54 83 137
399  
400 83 ▶ return $expr_type eq $target_type ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$expr_type eq $target_type ? : 82 1 83
401 }
402  
403 21057 ▶sub _expr_static_type {
Subroutine _expr_static_type: called CC=26 SCAR=34.7
404 21057 my ( $self, $expr ) = @_;
405  
406 21057 ▶ return undef if !defined $expr;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $expr 0 21057 21057
407 21057 ▶ return undef if !blessed($expr);
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($expr) 0 21057 21057
408  
409 21057 ▶ if ( $expr->isa('Zuzu::AST::Expr::Var') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($expr->isa("Zuzu::AST::Expr::Var")) 10475 10582 21057
410 10475 my $declared_type = $self->_lookup_declared_type( $expr->name );
411 10475 ▶ return undef if !defined $declared_type or $declared_type eq 'Any';
Branch: 1 branch
BranchTrueFalseTotal
if not defined $declared_type or $declared_type eq "Any" 8711 1764 10475
Condition66%2/3
not defined $declared_type or $declared_type eq "Any"
l!l&&r!l&&!r
087111764
MC/DC50%1/2
not defined $declared_type or $declared_type eq "Any"
not defined $declared_type $declared_type eq "Any"
Truth table66%2/3
not(A) or B
A= not defined $declared_typeB= $declared_type eq "Any"
ABresult
1X1
011
000
412 1764 return $declared_type;
413 }
414  
415 10582 ▶ if ( $expr->isa('Zuzu::AST::Expr::Literal') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($expr->isa("Zuzu::AST::Expr::Literal")) 5957 4625 10582
416 5957 my $value = $expr->value;
417  
418 5957 ▶ return 'Null' if !defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 271 5686 5957
419 5686 ▶ return 'Boolean' if blessed($value) and $value->isa('Zuzu::Value::Boolean');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($value) and $value->isa("Zuzu::Value::Boolean") 386 5300 5686
Condition100%3/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Boolean")
!ll&&!rl&&r
525941386
MC/DC100%2/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Boolean")
builtin::blessed($value) $value->isa("Zuzu::Value::Boolean")
Truth table100%3/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Boolean")
ABresult
0X0
100
111
420 5300 ▶ return 'Array' if blessed($value) and $value->isa('Zuzu::Value::Array');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($value) and $value->isa("Zuzu::Value::Array") 0 5300 5300
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Array")
!ll&&!rl&&r
5259410
MC/DC0%0/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Array")
builtin::blessed($value) $value->isa("Zuzu::Value::Array")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Array")
ABresult
0X0
100
111
421 5300 ▶ return 'Dict' if blessed($value) and $value->isa('Zuzu::Value::Dict');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($value) and $value->isa("Zuzu::Value::Dict") 0 5300 5300
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Dict")
!ll&&!rl&&r
5259410
MC/DC0%0/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Dict")
builtin::blessed($value) $value->isa("Zuzu::Value::Dict")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Dict")
ABresult
0X0
100
111
422 5300 ▶ return 'Set' if blessed($value) and $value->isa('Zuzu::Value::Set');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($value) and $value->isa("Zuzu::Value::Set") 0 5300 5300
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Set")
!ll&&!rl&&r
5259410
MC/DC0%0/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Set")
builtin::blessed($value) $value->isa("Zuzu::Value::Set")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Set")
ABresult
0X0
100
111
423 5300 ▶ return 'Bag' if blessed($value) and $value->isa('Zuzu::Value::Bag');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($value) and $value->isa("Zuzu::Value::Bag") 0 5300 5300
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Bag")
!ll&&!rl&&r
5259410
MC/DC0%0/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Bag")
builtin::blessed($value) $value->isa("Zuzu::Value::Bag")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Bag")
ABresult
0X0
100
111
424 5300 ▶ return 'Function' if blessed($value) and $value->isa('Zuzu::Value::Function');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($value) and $value->isa("Zuzu::Value::Function") 0 5300 5300
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Function")
!ll&&!rl&&r
5259410
MC/DC0%0/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Function")
builtin::blessed($value) $value->isa("Zuzu::Value::Function")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Function")
ABresult
0X0
100
111
425 5300 ▶ return 'Class' if blessed($value) and $value->isa('Zuzu::Value::Class');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($value) and $value->isa("Zuzu::Value::Class") 0 5300 5300
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Class")
!ll&&!rl&&r
5259410
MC/DC0%0/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Class")
builtin::blessed($value) $value->isa("Zuzu::Value::Class")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Class")
ABresult
0X0
100
111
426 5300 ▶ return 'Object' if blessed($value) and $value->isa('Zuzu::Value::Object');
Branch: 1 branch
BranchTrueFalseTotal
if builtin::blessed($value) and $value->isa("Zuzu::Value::Object") 0 5300 5300
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Object")
!ll&&!rl&&r
5259410
MC/DC0%0/2
builtin::blessed($value) and $value->isa("Zuzu::Value::Object")
builtin::blessed($value) $value->isa("Zuzu::Value::Object")
Truth table66%2/3
A and B
A= builtin::blessed($value)B= $value->isa("Zuzu::Value::Object")
ABresult
0X0
100
111
427 5300 ▶ return 'Number' if !ref($value) and $value =~ /^-?(?:\d+(?:\.\d+)?|\.\d+)$/;
Branch: 1 branch
BranchTrueFalseTotal
if not ref $value and $value =~ /^-?(?:\d+(?:\.\d+)?|\.\d+)$/ 1543 3757 5300
Condition100%3/3
not ref $value and $value =~ /^-?(?:\d+(?:\.\d+)?|\.\d+)$/
!ll&&!rl&&r
4137161543
MC/DC100%2/2
not ref $value and $value =~ /^-?(?:\d+(?:\.\d+)?|\.\d+)$/
not ref $value $value =~ /^-?(?:\d+(?:\.\d+)?|\.\d+)$/
Truth table100%3/3
not(A) and B
A= not ref $valueB= $value =~ /^-?(?:\d+(?:\.\d+)?|\.\d+)$/
ABresult
0X0
100
111
428  
429 3757 return 'String';
430 }
431  
432 4625 return undef;
433 }
434  
435 78 1;
436  
437 =pod
438  
439 =head1 COPYRIGHT AND LICENCE
440  
441 B<< Zuzu::AST::Visitor::TypeCheckHints >> is copyright Toby Inkster.
442  
443 It is free software; you may redistribute it and/or modify it under
444 the terms of either the Artistic License 1.0 or the GNU General Public
445 License version 2.
446  
447 =cut
« blib/lib/Zuzu/Module/TUI.pm ↑ Summary blib/lib/Zuzu/Module/DB.pm »