File Coverage

File:blib/lib/Inline/Echo.pm
Coverage:40.0%

linestmtbrancondsubtimecode
1package Inline::Echo;
2
3$VERSION = '0.01';
4
5require Inline;
6require Inline::Interp;
7
8@ISA = qw(Inline Inline::Interp);
9
10
1
1
1
5
2
6
use strict;
11
1
1
1
5
2
9
use Carp;
12
13sub register {
14        return {
15
0
                language => 'Echo',
16                aliases => ['Echo', 'echo'],
17                type => 'interpreted',
18                suffix => 'echo',
19        };
20}
21
22sub do_load {
23
0
        my ($funcs, $code) = @_;
24
25
0
        while($code =~ m/function(\s+)([a-z0-9_]+)(\s*){(.*?)}/isg){
26
0
                Inline::Interp::add_func($funcs, $2, $4);
27        }
28}
29
30sub load {
31
0
        Inline::Interp::load(@_);
32}
33
34sub do_run {
35
0
        my ($code, $io) = @_;
36
37
0
0
        Inline::Interp::output_char($io, $_) for split //, $code;
38}
39
401;
41