| 1 | 4 | ▶ | class Mildew::AST::Block extends Mildew::AST::Base { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
__ANON__: called CC=1 SCAR=2.2
| |||||||||||
| 2 | 4 | has 'stmts' => (is=>'ro',isa=>'ArrayRef[Mildew::AST::Base]'); | |||||||||
| 3 | 0 | ▶ | has 'regs' => (is=>'ro',default=>sub {[]},isa=>'ArrayRef[Str]'); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 4 | 0 | ▶ | method m0ld($ret) { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
Subroutine
__ANON__: not called CC=1 SCAR=4.9
| |||||||||||
| 5 | "my $ret = mold {\n" | ||||||||||
| 6 | 0 | . join('',map {'my $'.$_.";\n"} @{$self->regs}) | |||||||||
| 7 | 0 | . join("",map { $_->m0ld('$void') } @{$self->stmts}) | |||||||||
| 8 | . "};\n"; | ||||||||||
| 9 | 4 | } | |||||||||
| 10 | 0 | ▶ | method pretty { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
Subroutine
__ANON__: not called CC=2 SCAR=15.9
| |||||||||||
| 11 | 0 | ▶ | return 'mold {...}' if defined $Mildew::consise_pretty; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | "mold \{\n". Mildew::AST::indent( | ||||||||||
| 13 | 0 | join('',map {'my $'.$_.";\n"} @{$self->regs}) | |||||||||
| 14 | 0 | . join("",map {Mildew::AST::terminate_stmt $_->pretty } @{$self->stmts}) | |||||||||
| 15 | ) . "\}" | ||||||||||
| 16 | 4 | } | |||||||||
| 17 | 0 | ▶ | method simplified { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
Subroutine
__ANON__: not called CC=3 SCAR=22.8
| |||||||||||
| 18 | 0 | my @stmts; | |||||||||
| 19 | my $value; | ||||||||||
| 20 | 0 | for (@{$self->stmts}) { | |||||||||
| 21 | 0 | my @side_effects; | |||||||||
| 22 | 0 | ($value,@side_effects) = $_->simplified; | |||||||||
| 23 | 0 | push (@stmts,@side_effects); | |||||||||
| 24 | } | ||||||||||
| 25 | 0 | ▶ | Mildew::AST::Block::Simplified->new(regs=>$self->regs,stmts=>[@stmts,$value ? ($value) : ()]); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 4 | } | |||||||||
| 27 | 0 | ▶ | method took { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
Subroutine
__ANON__: not called CC=2 SCAR=15.1
| |||||||||||
| 28 | 0 | my $took = 0; | |||||||||
| 29 | 0 | for (@{$self->stmts}) { | |||||||||
| 30 | 0 | $took += $_->took; | |||||||||
| 31 | } | ||||||||||
| 32 | 0 | $took; | |||||||||
| 33 | 4 | } | |||||||||
| 34 | 0 | ▶ | method forest { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
Subroutine
__ANON__: not called CC=2 SCAR=15.4
| |||||||||||
| 35 | 0 | local $Mildew::consise_pretty = 1; | |||||||||
| 36 | 0 | ▶ | Forest::Tree->new(node=> 'mold {...}' . ($Mildew::took ? ' - ' . sprintf("%.4f",$self->took) : ''),children=>[map {$_->forest } @{$self->stmts}]); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 4 | } | |||||||||
| 38 | 4 | ▶ | } | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||