line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tangerine::hook::inline; |
2
|
|
|
|
|
|
|
$Tangerine::hook::inline::VERSION = '0.23'; |
3
|
16
|
|
|
16
|
|
785
|
use 5.010; |
|
16
|
|
|
|
|
33
|
|
4
|
16
|
|
|
16
|
|
48
|
use strict; |
|
16
|
|
|
|
|
20
|
|
|
16
|
|
|
|
|
219
|
|
5
|
16
|
|
|
16
|
|
49
|
use warnings; |
|
16
|
|
|
|
|
17
|
|
|
16
|
|
|
|
|
303
|
|
6
|
16
|
|
|
16
|
|
42
|
use parent 'Tangerine::Hook'; |
|
16
|
|
|
|
|
16
|
|
|
16
|
|
|
|
|
51
|
|
7
|
16
|
|
|
16
|
|
727
|
use Tangerine::HookData; |
|
16
|
|
|
|
|
17
|
|
|
16
|
|
|
|
|
221
|
|
8
|
16
|
|
|
16
|
|
41
|
use Tangerine::Occurence; |
|
16
|
|
|
|
|
15
|
|
|
16
|
|
|
|
|
271
|
|
9
|
16
|
|
|
16
|
|
43
|
use Tangerine::Utils qw(any stripquotelike $vre); |
|
16
|
|
|
|
|
15
|
|
|
16
|
|
|
|
|
6999
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my %langmap = ( |
12
|
|
|
|
|
|
|
(map { $_ => 'ASM' } qw/nasm NASM gasp GASP as AS asm/), |
13
|
|
|
|
|
|
|
(map { $_ => 'Awk' } qw/AWK awk/), |
14
|
|
|
|
|
|
|
basic => 'Basic', |
15
|
|
|
|
|
|
|
(map { $_ => 'BC' } qw/bc Bc/), |
16
|
|
|
|
|
|
|
(map { $_ => 'Befunge' } qw/befunge BEFUNGE bef BEF/), |
17
|
|
|
|
|
|
|
c => 'C', |
18
|
|
|
|
|
|
|
(map { $_ => 'CPP' } qw/cpp C++ c++ Cplusplus cplusplus CXX cxx/), |
19
|
|
|
|
|
|
|
GUILE => 'Guile', |
20
|
|
|
|
|
|
|
(map { $_ => 'Java' } qw/JAVA java/), |
21
|
|
|
|
|
|
|
lua => 'Lua', |
22
|
|
|
|
|
|
|
MZSCHEME => 'MzScheme', |
23
|
|
|
|
|
|
|
nouse => 'Nouse', |
24
|
|
|
|
|
|
|
octave => 'Octave', |
25
|
|
|
|
|
|
|
(map { $_ => 'Pdlpp' } qw/pdlpp PDLPP/), |
26
|
|
|
|
|
|
|
perl => 'Perl', |
27
|
|
|
|
|
|
|
(map { $_ => 'Python' } qw/py python PYTHON/), |
28
|
|
|
|
|
|
|
(map { $_ => 'Ruby' } qw/rb ruby RUBY/), |
29
|
|
|
|
|
|
|
(map { $_ => 'SLang' } qw/sl slang/), |
30
|
|
|
|
|
|
|
(map { $_ => 'SMITH' } qw/Smith smith/), |
31
|
|
|
|
|
|
|
(map { $_ => 'Tcl' } qw/tcl tk/), |
32
|
|
|
|
|
|
|
(map { $_ => 'TT' } qw/tt template/), |
33
|
|
|
|
|
|
|
webchat => 'WebChat', |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub run { |
37
|
138
|
|
|
138
|
1
|
124
|
my ($self, $s) = @_; |
38
|
138
|
100
|
100
|
195
|
|
306
|
if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 2 && |
|
195
|
|
100
|
|
|
592
|
|
39
|
|
|
|
|
|
|
$s->[1] eq 'Inline') { |
40
|
10
|
|
|
|
|
180
|
my ($version) = $s->[2] =~ $vre; |
41
|
10
|
|
50
|
|
|
96
|
$version //= ''; |
42
|
10
|
50
|
|
|
|
12
|
my $voffset = $version ? 3 : 2; |
43
|
10
|
|
|
|
|
9
|
my @args; |
44
|
10
|
50
|
|
|
|
12
|
if (scalar(@$s) > $voffset) { |
45
|
10
|
100
|
|
|
|
14
|
return if $s->[$voffset] eq ';'; |
46
|
9
|
|
|
|
|
103
|
@args = @$s; |
47
|
9
|
|
|
|
|
18
|
@args = @args[($voffset) .. $#args]; |
48
|
9
|
|
|
|
|
19
|
@args = stripquotelike(@args); |
49
|
|
|
|
|
|
|
} |
50
|
9
|
|
|
|
|
8
|
my @modules; |
51
|
9
|
100
|
|
|
|
18
|
if ($args[0] =~ /config/io) { |
|
|
100
|
|
|
|
|
|
52
|
|
|
|
|
|
|
return |
53
|
1
|
|
|
|
|
5
|
} elsif ($args[0] =~ /with/io) { |
54
|
3
|
|
|
|
|
4
|
shift @args; |
55
|
3
|
|
|
|
|
3
|
push @modules, @args; |
56
|
|
|
|
|
|
|
} else { |
57
|
5
|
|
66
|
|
|
23
|
push @modules, 'Inline::'.($langmap{$args[0]} // $args[0]) |
58
|
|
|
|
|
|
|
} |
59
|
8
|
50
|
|
12
|
|
36
|
if (any { $_ eq 'FILTERS' } @args) { |
|
12
|
|
|
|
|
13
|
|
60
|
0
|
|
|
|
|
0
|
push @modules, 'Inline::Filters' |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
return Tangerine::HookData->new( |
63
|
|
|
|
|
|
|
modules => { |
64
|
|
|
|
|
|
|
map { |
65
|
8
|
|
|
|
|
35
|
( $_ => Tangerine::Occurence->new() ) |
|
9
|
|
|
|
|
17
|
|
66
|
|
|
|
|
|
|
} @modules, |
67
|
|
|
|
|
|
|
}, |
68
|
|
|
|
|
|
|
); |
69
|
|
|
|
|
|
|
} |
70
|
128
|
|
|
|
|
1493
|
return; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
__END__ |