line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
11
|
|
|
11
|
|
88
|
use strict; use warnings; |
|
11
|
|
|
11
|
|
24
|
|
|
11
|
|
|
|
|
358
|
|
|
11
|
|
|
|
|
57
|
|
|
11
|
|
|
|
|
32
|
|
|
11
|
|
|
|
|
430
|
|
2
|
|
|
|
|
|
|
package YAMLScript::RT; |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
5257
|
use Lingy::RT; |
|
11
|
|
|
|
|
22006
|
|
|
11
|
|
|
|
|
400
|
|
5
|
11
|
|
|
11
|
|
138
|
use base 'Lingy::RT'; |
|
11
|
|
|
|
|
27
|
|
|
11
|
|
|
|
|
1594
|
|
6
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
3853
|
use YAMLScript; |
|
11
|
|
|
|
|
29
|
|
|
11
|
|
|
|
|
299
|
|
8
|
11
|
|
|
11
|
|
411
|
use YAMLScript::Common; |
|
11
|
|
|
|
|
62
|
|
|
11
|
|
|
|
|
2528
|
|
9
|
11
|
|
|
11
|
|
4211
|
use YAMLScript::Core; |
|
11
|
|
|
|
|
35
|
|
|
11
|
|
|
|
|
340
|
|
10
|
11
|
|
|
11
|
|
528
|
use YAMLScript::Reader; |
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
272
|
|
11
|
11
|
|
|
11
|
|
4717
|
use YAMLScript::ReadLine; |
|
11
|
|
|
|
|
32
|
|
|
11
|
|
|
|
|
329
|
|
12
|
|
|
|
|
|
|
|
13
|
11
|
|
|
11
|
|
70
|
use constant LANG => 'YAMLScript'; |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
573
|
|
14
|
11
|
|
|
11
|
|
65
|
use constant reader_class => 'YAMLScript::Reader'; |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
730
|
|
15
|
11
|
|
|
11
|
|
64
|
use constant RL => YAMLScript::ReadLine->new; |
|
11
|
|
|
|
|
26
|
|
|
11
|
|
|
|
|
80
|
|
16
|
|
|
|
|
|
|
|
17
|
11
|
|
|
|
|
4125
|
use constant repl_intro_command => |
18
|
11
|
|
|
11
|
|
684
|
q<(println (str *LANG* " " (yamlscript-version) " [" *HOST* "]\n"))>; |
|
11
|
|
|
|
|
24
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub class_names { |
21
|
|
|
|
|
|
|
[ |
22
|
10
|
|
|
10
|
0
|
28
|
@{Lingy::RT::class_names()}, |
|
10
|
|
|
|
|
49
|
|
23
|
|
|
|
|
|
|
'Lingy::RT', |
24
|
|
|
|
|
|
|
'YAMLScript::Core', |
25
|
|
|
|
|
|
|
]; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $reader; |
29
|
1
|
|
|
1
|
0
|
1225
|
sub reader { $reader } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub init { |
32
|
11
|
|
|
11
|
0
|
195
|
my $self = shift; |
33
|
11
|
|
|
|
|
240
|
$self->SUPER::init(@_); |
34
|
11
|
|
|
|
|
693
|
$reader = $self->require_new($self->reader_class); |
35
|
11
|
|
|
|
|
68
|
$self->rep(q< (use 'YAMLScript.Core) >); |
36
|
11
|
|
|
|
|
2421
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub core_namespace { |
40
|
11
|
|
|
11
|
0
|
36344
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
11
|
|
|
|
|
126
|
my $ns = $self->SUPER::core_namespace(@_); |
43
|
|
|
|
|
|
|
|
44
|
11
|
|
|
|
|
4741
|
$YAMLScript::VERSION =~ /^(\d+)\.(\d+)\.(\d+)$/; |
45
|
11
|
|
|
|
|
155
|
$self->rep(" |
46
|
|
|
|
|
|
|
(def *yamlscript-version* |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
:major $1 |
49
|
|
|
|
|
|
|
:minor $2 |
50
|
|
|
|
|
|
|
:incremental $3 |
51
|
|
|
|
|
|
|
:qualifier nil |
52
|
|
|
|
|
|
|
}) |
53
|
|
|
|
|
|
|
"); |
54
|
|
|
|
|
|
|
|
55
|
11
|
|
|
|
|
888
|
return $ns; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub is_lingy_class { |
59
|
1298
|
|
|
1298
|
0
|
2710
|
my ($self, $class) = @_; |
60
|
1298
|
50
|
|
|
|
10970
|
$class->isa(CLASS) or $class =~ /^(?:Lingy|YAMLScript)::\w/; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# TODO Find cleaner way to override 'require' to support .ys files. |
65
|
11
|
|
|
11
|
|
284
|
use Lingy::RT; |
|
11
|
|
|
|
|
36
|
|
|
11
|
|
|
|
|
460
|
|
66
|
|
|
|
|
|
|
package Lingy::RT; |
67
|
|
|
|
|
|
|
|
68
|
11
|
|
|
11
|
|
73
|
no warnings 'redefine'; |
|
11
|
|
|
|
|
26
|
|
|
11
|
|
|
|
|
5181
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub require { |
71
|
|
|
|
|
|
|
outer: |
72
|
11
|
|
|
11
|
0
|
848
|
for my $spec (@_) { |
73
|
11
|
50
|
|
|
|
72
|
err "'require' only works with symbols" |
74
|
|
|
|
|
|
|
unless ref($spec) eq SYMBOL; |
75
|
|
|
|
|
|
|
|
76
|
11
|
50
|
|
|
|
66
|
return nil if $Lingy::Main::ns{$$spec}; |
77
|
|
|
|
|
|
|
|
78
|
11
|
|
|
|
|
47
|
my $name = $$spec; |
79
|
|
|
|
|
|
|
|
80
|
11
|
|
|
|
|
33
|
my $path = $name; |
81
|
11
|
|
|
|
|
49
|
$path =~ s/^lingy\.lang\./Lingy./; |
82
|
11
|
|
|
|
|
34
|
$path =~ s/^lingy\./Lingy./; |
83
|
11
|
|
|
|
|
38
|
$path =~ s/^ys\./YAMLScript./; |
84
|
11
|
|
|
|
|
27
|
my $module = $path; |
85
|
11
|
|
|
|
|
58
|
$path =~ s/\./\//g; |
86
|
|
|
|
|
|
|
|
87
|
11
|
|
|
|
|
41
|
for my $inc (@INC) { |
88
|
12
|
|
|
|
|
96
|
$inc =~ s{^([^/.])}{./$1}; |
89
|
12
|
|
|
|
|
61
|
my $inc_path = "$inc/$path"; |
90
|
12
|
100
|
66
|
|
|
614
|
if (-f "$inc_path.ly" or |
91
|
|
|
|
|
|
|
-f "$inc_path.ys" |
92
|
|
|
|
|
|
|
) { |
93
|
11
|
50
|
|
|
|
193
|
if (-f "$inc_path.ly") { |
94
|
11
|
|
|
|
|
86
|
my $ns = RT->current_ns; |
95
|
11
|
|
|
|
|
99
|
RT->rep(qq< (load-file "$inc_path.ly") >); |
96
|
11
|
|
|
|
|
1124
|
$ns->current; |
97
|
|
|
|
|
|
|
} |
98
|
11
|
50
|
|
|
|
387
|
if (-f "$inc_path.ys") { |
99
|
0
|
|
|
|
|
0
|
my $ns = RT->current_ns; |
100
|
0
|
|
|
|
|
0
|
RT->rep(qq< (load-file "$inc_path.ys") >); |
101
|
0
|
|
|
|
|
0
|
$ns->current; |
102
|
|
|
|
|
|
|
} |
103
|
11
|
|
|
|
|
89
|
next outer; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
} |
106
|
0
|
|
|
|
|
0
|
err "Can't find library for (require '$name)"; |
107
|
|
|
|
|
|
|
} |
108
|
11
|
|
|
|
|
71
|
return nil; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
1; |