| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 11705 | ▶ | $declared_type //= 'Any'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$declared_type //= "Any"
MC/DC0%0/1
$declared_type //= "Any"
$declared_type
Truth table50%1/2
A
A= $declared_type
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | 11819 | ▶ | for ( my $i = $#{ $self->_scope_stack }; $i >= 0; $i-- ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | 21919 | my $scope = $self->_scope_stack->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 62 | 21919 | ▶ | return $scope->{ $name } if exists $scope->{ $name }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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 // []
MC/DC0%0/1
$node->params // []
$node->params
Truth table50%1/2
A
A= $node->params
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | 4997 | ▶ | my $declared_type = $node->param_types->{$name} // 'Any'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->param_types->{$name} // "Any"
MC/DC0%0/1
$node->param_types->{$name} // "Any"
$node->param_types->{$name}
Truth table50%1/2
A
A= $node->param_types->{$name}
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | 4997 | $self->_declare_typed_name( $name, $declared_type ); | |||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||
| 89 | 3557 | ▶ | if ( defined $node->vararg ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 62 | ▶ | my $declared_type = $node->vararg_type // 'Any'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->vararg_type // "Any"
MC/DC0%0/1
$node->vararg_type // "Any"
$node->vararg_type
Truth table50%1/2
A
A= $node->vararg_type
| |||||||||||||||||||||||||||||||||||||||||||
| 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 // {}
MC/DC0%0/1
$node->param_defaults // {}
$node->param_defaults
Truth table50%1/2
A
A= $node->param_defaults
| |||||||||||||||||||||||||||||||||||||||||||
| 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"
MC/DC0%0/1
$node->param_types->{$name} // "Any"
$node->param_types->{$name}
Truth table50%1/2
A
A= $node->param_types->{$name}
| |||||||||||||||||||||||||||||||||||||||||||
| 98 | 174 | ▶ | if ( $self->_expr_matches_type( $default_expr, $declared_type ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition100%3/3
$node->can("is_predeclared") and $node->is_predeclared
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
| |||||||||||||||||||||||||||||||||||||||||||
| 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"
MC/DC0%0/1
$node->return_type // "Any"
$node->return_type
Truth table50%1/2
A
A= $node->return_type
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 144045 | ▶ | return if !blessed($node); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||
| 122 | 144045 | ▶ | if ( $node->isa('Zuzu::AST::Program') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 123 | 753 | ▶ | for my $stmt ( @{ $node->statements // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->statements // []
MC/DC0%0/1
$node->statements // []
$node->statements
Truth table50%1/2
A
A= $node->statements
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | 3910 | $self->_visit_node($stmt); | |||||||||||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||||||||||
| 126 | 753 | return; | |||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||
| 129 | 143292 | ▶ | if ( $node->isa('Zuzu::AST::Block') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 130 | 9330 | ▶ | for my $stmt ( @{ $node->statements // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->statements // []
MC/DC0%0/1
$node->statements // []
$node->statements
Truth table50%1/2
A
A= $node->statements
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | 22076 | $self->_visit_node($stmt); | |||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||
| 133 | 9330 | return; | |||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||
| 136 | 133962 | ▶ | if ( $node->isa('Zuzu::AST::Stmt::Let') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | 5727 | ▶ | $self->_visit_node( $node->init ) if defined $node->init; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | 5727 | ▶ | my $declared_type = $node->declared_type // 'Any'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->declared_type // "Any"
MC/DC0%0/1
$node->declared_type // "Any"
$node->declared_type
Truth table50%1/2
A
A= $node->declared_type
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | 5727 | ▶ | if ( defined $node->init and $declared_type ne 'Any' ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $node->init and $declared_type ne "Any"
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"
| |||||||||||||||||||||||||||||||||||||||||||
| 140 | 14 | ▶ | if ( $self->_expr_matches_type( $node->init, $declared_type ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 149 | 18 | ▶ | for my $binding ( @{ $node->bindings // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->bindings // []
MC/DC0%0/1
$node->bindings // []
$node->bindings
Truth table50%1/2
A
A= $node->bindings
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | 27 | $self->_visit_node( $binding->{key_expr} ); | |||||||||||||||||||||||||||||||||||||||||
| 151 | $self->_visit_node( $binding->{default_expr} ) | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 27 | ▶ | if $binding->{has_default}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||
| 154 | 18 | ▶ | $self->_visit_node( $node->init ) if defined $node->init; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | 18 | ▶ | for my $binding ( @{ $node->bindings // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->bindings // []
MC/DC0%0/1
$node->bindings // []
$node->bindings
Truth table50%1/2
A
A= $node->bindings
| |||||||||||||||||||||||||||||||||||||||||||
| 156 | $self->_declare_typed_name( | ||||||||||||||||||||||||||||||||||||||||||
| 157 | $binding->{name}, | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 27 | ▶ | $binding->{declared_type} // 'Any', | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$binding->{"declared_type"} // "Any"
MC/DC0%0/1
$binding->{"declared_type"} // "Any"
$binding->{"declared_type"}
Truth table50%1/2
A
A= $binding->{"declared_type"}
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||
| 161 | 18 | return; | |||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||
| 164 | 128217 | ▶ | if ( $node->isa('Zuzu::AST::Stmt::Assign') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition83%5/6
$node->op eq ":=" and builtin::blessed($node->target) and $node->target->isa("Zuzu::AST::Expr::Var")
$node->op eq ":=" and builtin::blessed($node->target)
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition100%3/3
$declared_type ne "Any" and $self->_expr_matches_type($node->expr, $declared_type)
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)
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 178 | 4071 | $self->_visit_node( $node->expr ); | |||||||||||||||||||||||||||||||||||||||||
| 179 | 4071 | return; | |||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | 121951 | ▶ | if ( $node->isa('Zuzu::AST::Stmt::Return') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 183 | 5320 | ▶ | $self->_visit_node( $node->expr ) if $node->can('expr'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 184 | 5320 | ▶ | if ( @{ $self->_return_type_stack } and defined $node->expr ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@{$self->_return_type_stack;} and defined $node->expr
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
| |||||||||||||||||||||||||||||||||||||||||||
| 185 | 5208 | ▶ | my $declared_return_type = $self->_return_type_stack->[-1] // 'Any'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->_return_type_stack->[-1] // "Any"
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]
| |||||||||||||||||||||||||||||||||||||||||||
| 186 | 5208 | ▶ | if ( $declared_return_type ne 'Any' and $self->_expr_matches_type( $node->expr, $declared_return_type ) ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$declared_return_type ne "Any" and $self->_expr_matches_type($node->expr, $declared_return_type)
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)
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 197 | 3860 | return; | |||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||
| 200 | 112771 | ▶ | if ( $node->isa('Zuzu::AST::Stmt::PostfixIf') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | 740 | $self->_visit_node( $node->collection ); | |||||||||||||||||||||||||||||||||||||||||
| 214 | 740 | $self->_push_scope; | |||||||||||||||||||||||||||||||||||||||||
| 215 | 740 | ▶ | if ( $node->declare_loop_var ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition100%6/6
$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") or $node->isa("Zuzu::AST::Expr::Function")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 225 | 3557 | $self->_visit_function_like($node); | |||||||||||||||||||||||||||||||||||||||||
| 226 | 3557 | return; | |||||||||||||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||
| 229 | 106773 | ▶ | if ( $node->isa('Zuzu::AST::Stmt::Class') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 302 | ▶ | $self->_visit_node( $node->parent ) if defined $node->parent; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 231 | 302 | ▶ | for my $trait_ref ( @{ $node->traits // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->traits // []
MC/DC0%0/1
$node->traits // []
$node->traits
Truth table50%1/2
A
A= $node->traits
| |||||||||||||||||||||||||||||||||||||||||||
| 232 | 20 | $self->_visit_node($trait_ref); | |||||||||||||||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||||||||||||||||
| 234 | 302 | ▶ | for my $field ( @{ $node->fields // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->fields // []
MC/DC0%0/1
$node->fields // []
$node->fields
Truth table50%1/2
A
A= $node->fields
| |||||||||||||||||||||||||||||||||||||||||||
| 235 | 468 | ▶ | next if !defined $field->{init}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 236 | 376 | $self->_visit_node( $field->{init} ); | |||||||||||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||||||||||
| 238 | 302 | ▶ | for my $method ( @{ $node->methods // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->methods // []
MC/DC0%0/1
$node->methods // []
$node->methods
Truth table50%1/2
A
A= $node->methods
| |||||||||||||||||||||||||||||||||||||||||||
| 239 | 1492 | $self->_visit_node($method); | |||||||||||||||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||||||||||||||||
| 241 | 302 | ▶ | for my $method ( @{ $node->static_methods // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->static_methods // []
MC/DC0%0/1
$node->static_methods // []
$node->static_methods
Truth table50%1/2
A
A= $node->static_methods
| |||||||||||||||||||||||||||||||||||||||||||
| 242 | 73 | $self->_visit_node($method); | |||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||
| 244 | 302 | ▶ | for my $klass ( @{ $node->classes // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->classes // []
MC/DC0%0/1
$node->classes // []
$node->classes
Truth table50%1/2
A
A= $node->classes
| |||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | $self->_visit_node($klass); | |||||||||||||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||||||||||||
| 247 | 302 | return; | |||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||
| 250 | 106471 | ▶ | if ( $node->isa('Zuzu::AST::Stmt::Trait') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 251 | 14 | ▶ | for my $method ( @{ $node->methods // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->methods // []
MC/DC0%0/1
$node->methods // []
$node->methods
Truth table50%1/2
A
A= $node->methods
| |||||||||||||||||||||||||||||||||||||||||||
| 252 | 32 | $self->_visit_node($method); | |||||||||||||||||||||||||||||||||||||||||
| 253 | } | ||||||||||||||||||||||||||||||||||||||||||
| 254 | 14 | return; | |||||||||||||||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||
| 257 | 106457 | ▶ | if ( $node->isa('Zuzu::AST::Stmt::Try') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 258 | 152 | $self->_visit_block_with_scope( $node->block ); | |||||||||||||||||||||||||||||||||||||||||
| 259 | 152 | ▶ | for my $catch ( @{ $node->catches // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->catches // []
MC/DC0%0/1
$node->catches // []
$node->catches
Truth table50%1/2
A
A= $node->catches
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | 154 | $self->_visit_node($catch); | |||||||||||||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||||||||||||
| 262 | 152 | return; | |||||||||||||||||||||||||||||||||||||||||
| 263 | } | ||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||
| 265 | 106305 | ▶ | if ( $node->isa('Zuzu::AST::Stmt::Catch') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition100%3/3
$node->isa("Zuzu::AST::Expr::Call") or $node->isa("Zuzu::AST::Expr::MemberCall")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 275 | 14758 | ▶ | $self->_visit_node( $node->callee ) if $node->can('callee'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 276 | 14758 | ▶ | $self->_visit_node( $node->object ) if $node->can('object'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 277 | 14758 | my @arg_types; | |||||||||||||||||||||||||||||||||||||||||
| 278 | 14758 | ▶ | for my $arg ( @{ $node->args // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->args // []
MC/DC0%0/1
$node->args // []
$node->args
Truth table50%1/2
A
A= $node->args
| |||||||||||||||||||||||||||||||||||||||||||
| 279 | 21109 | ▶ | my $expr = ref($arg) eq 'ARRAY' ? $arg->[1] : $arg; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 280 | 21109 | ▶ | if ( ref($arg) eq 'ARRAY' and $arg->[2] ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
ref $arg eq "ARRAY" and $arg->[2]
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]
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition66%2/3
builtin::blessed($expr) and $expr->isa("Zuzu::AST::Expr::Spread")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 285 | 21094 | ▶ | push @arg_types, $self->_expr_static_type($expr) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
ref $arg ne "ARRAY" or not defined $arg->[0]
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]
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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 // []
MC/DC0%0/1
$node->args // []
$node->args
Truth table50%1/2
A
A= $node->args
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | 7 | ▶ | my $expr = ref($arg) eq 'ARRAY' ? $arg->[1] : $arg; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 297 | 7 | ▶ | if ( ref($arg) eq 'ARRAY' and $arg->[2] ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $arg eq "ARRAY" and $arg->[2]
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]
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 306 | 19 | $self->_visit_node( $node->expr ); | |||||||||||||||||||||||||||||||||||||||||
| 307 | 19 | return; | |||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||||||||||||
| 310 | 91363 | ▶ | if ( $node->isa('Zuzu::AST::Expr::Binary') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition100%3/3
$node->isa("Zuzu::AST::Expr::Await") or $node->isa("Zuzu::AST::Expr::Spawn")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 327 | 596 | $self->_visit_node( $node->cond ); | |||||||||||||||||||||||||||||||||||||||||
| 328 | 596 | ▶ | $self->_visit_node( $node->if_true ) if defined $node->if_true; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 346 | 23 | $self->_visit_node( $node->collection ); | |||||||||||||||||||||||||||||||||||||||||
| 347 | 23 | ▶ | $self->_visit_node( $node->start ) if defined $node->start; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 348 | 23 | ▶ | $self->_visit_node( $node->length ) if defined $node->length; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 349 | 23 | return; | |||||||||||||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||
| 352 | 74183 | ▶ | if ( $node->isa('Zuzu::AST::Expr::IncDec') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition100%6/6
$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") or $node->isa("Zuzu::AST::Expr::Set")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 358 | 1228 | ▶ | for my $item ( @{ $node->items // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->items // []
MC/DC0%0/1
$node->items // []
$node->items
Truth table50%1/2
A
A= $node->items
| |||||||||||||||||||||||||||||||||||||||||||
| 359 | 1723 | $self->_visit_node($item); | |||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||
| 361 | 1228 | return; | |||||||||||||||||||||||||||||||||||||||||
| 362 | } | ||||||||||||||||||||||||||||||||||||||||||
| 363 | 72265 | ▶ | if ( $node->isa('Zuzu::AST::Expr::Range') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 370 | 814 | ▶ | for my $pair ( @{ $node->pairs // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->pairs // []
MC/DC0%0/1
$node->pairs // []
$node->pairs
Truth table50%1/2
A
A= $node->pairs
| |||||||||||||||||||||||||||||||||||||||||||
| 371 | 2231 | ▶ | next if ref($pair) ne 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 379 | 755 | $self->_visit_node( $node->class_expr ); | |||||||||||||||||||||||||||||||||||||||||
| 380 | 755 | ▶ | for my $trait_ref ( @{ $node->traits // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->traits // []
MC/DC0%0/1
$node->traits // []
$node->traits
Truth table50%1/2
A
A= $node->traits
| |||||||||||||||||||||||||||||||||||||||||||
| 381 | 3 | $self->_visit_node( $trait_ref ); | |||||||||||||||||||||||||||||||||||||||||
| 382 | } | ||||||||||||||||||||||||||||||||||||||||||
| 383 | 755 | ▶ | for my $pair ( @{ $node->args // [] } ) { | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$node->args // []
MC/DC0%0/1
$node->args // []
$node->args
Truth table50%1/2
A
A= $node->args
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition66%2/3
not defined $target_type or $target_type eq "Any"
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"
| |||||||||||||||||||||||||||||||||||||||||||
| 396 | |||||||||||||||||||||||||||||||||||||||||||
| 397 | 137 | my $expr_type = $self->_expr_static_type($expr); | |||||||||||||||||||||||||||||||||||||||||
| 398 | 137 | ▶ | return 0 if !defined $expr_type; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 399 | |||||||||||||||||||||||||||||||||||||||||||
| 400 | 83 | ▶ | return $expr_type eq $target_type ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||
| 407 | 21057 | ▶ | return undef if !blessed($expr); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||||||||||||||||
| 409 | 21057 | ▶ | if ( $expr->isa('Zuzu::AST::Expr::Var') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 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
Condition66%2/3
not defined $declared_type or $declared_type eq "Any"
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"
| |||||||||||||||||||||||||||||||||||||||||||
| 412 | 1764 | return $declared_type; | |||||||||||||||||||||||||||||||||||||||||
| 413 | } | ||||||||||||||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||||||||||||||
| 415 | 10582 | ▶ | if ( $expr->isa('Zuzu::AST::Expr::Literal') ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 416 | 5957 | my $value = $expr->value; | |||||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||||
| 418 | 5957 | ▶ | return 'Null' if !defined $value; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 419 | 5686 | ▶ | return 'Boolean' if blessed($value) and $value->isa('Zuzu::Value::Boolean'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Boolean")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 420 | 5300 | ▶ | return 'Array' if blessed($value) and $value->isa('Zuzu::Value::Array'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Array")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 421 | 5300 | ▶ | return 'Dict' if blessed($value) and $value->isa('Zuzu::Value::Dict'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Dict")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 422 | 5300 | ▶ | return 'Set' if blessed($value) and $value->isa('Zuzu::Value::Set'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Set")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 423 | 5300 | ▶ | return 'Bag' if blessed($value) and $value->isa('Zuzu::Value::Bag'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Bag")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 424 | 5300 | ▶ | return 'Function' if blessed($value) and $value->isa('Zuzu::Value::Function'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Function")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 425 | 5300 | ▶ | return 'Class' if blessed($value) and $value->isa('Zuzu::Value::Class'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Class")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 426 | 5300 | ▶ | return 'Object' if blessed($value) and $value->isa('Zuzu::Value::Object'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($value) and $value->isa("Zuzu::Value::Object")
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")
| |||||||||||||||||||||||||||||||||||||||||||
| 427 | 5300 | ▶ | return 'Number' if !ref($value) and $value =~ /^-?(?:\d+(?:\.\d+)?|\.\d+)$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not ref $value and $value =~ /^-?(?:\d+(?:\.\d+)?|\.\d+)$/
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+)$/
| |||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||