blib/lib/Inline/Nouse.pm

filter: Statementstmt 92.8% 26 / 28 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 66.6% 4 / 6 totaltotal 86.3% 38 / 44 CC 2 SCAR 3.7
CC
2
Cov
93%
register
2.0
do_load
2.0
get_char
2.0
CRAP 1.4
↑ Summary
1 package Inline::Nouse;
2  
3 1 $VERSION = '0.04';
4  
5 1 require Inline;
6 1 require Inline::Interp;
7 1 require Language::Nouse;
8  
9 1 @ISA = qw(Inline Inline::Interp);
10  
11 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 my $g_io;
15  
16 0 ▶sub register {
Subroutine register: not called CC=1 SCAR=6.9
Pod documented
17 return {
18 0 language => 'nouse',
19 aliases => ['Nouse', 'nouse'],
20 type => 'interpreted',
21 suffix => 'ns',
22 };
23 }
24  
25 1 ▶sub do_load {
Subroutine do_load: called CC=2 SCAR=6.9
Pod documented
26 1 my ($funcs, $code) = @_;
27  
28 1 ▶ while($code =~ m/function(\s+)([a-z0-9_]+)(\s*){(.*?)}/isg){
Branch: 1 branch
BranchTrueFalseTotal
if ($code =~ /function(\s+)([a-z0-9_]+)(\s*){(.*?)}/sig) 1 1 2
29 1 Inline::Interp::add_func($funcs, $2, $4);
30 }
31 }
32  
33 1 ▶sub load {
Subroutine load: called CC=1 SCAR=0.0
Pod documented
34 1 Inline::Interp::load(@_);
35 }
36  
37 0 ▶sub get_char {
Subroutine get_char: not called CC=1 SCAR=6.9
Pod undocumented
38 0 return Inline::Interp::input_char($g_io);
39 }
40  
41 14 ▶sub put_char {
Subroutine put_char: called CC=1 SCAR=0.0
Pod undocumented
42 14 my ($out) = @_;
43 14 Inline::Interp::output_char($g_io, $out);
44 }
45  
46 1 ▶sub do_run {
Subroutine do_run: called CC=1 SCAR=0.0
Pod documented
47 1 my ($code, $io) = @_;
48  
49 1 $g_io = $io;
50  
51 1 my $interp = new Language::Nouse;
52 1 $interp->load_linenoise($code);
53 1 $interp->set_get(\&get_char);
54 1 $interp->set_put(\&put_char);
55  
56 1 $interp->run();
57 }
58  
59 1 1;
60  
61 __END__
↑ Summary