line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
10
|
|
|
10
|
|
76
|
use strict; use warnings; |
|
10
|
|
|
10
|
|
20
|
|
|
10
|
|
|
|
|
299
|
|
|
10
|
|
|
|
|
50
|
|
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
361
|
|
2
|
|
|
|
|
|
|
package YAMLScript::RT; |
3
|
|
|
|
|
|
|
|
4
|
10
|
|
|
10
|
|
4647
|
use Lingy::RT; |
|
10
|
|
|
|
|
21245
|
|
|
10
|
|
|
|
|
345
|
|
5
|
10
|
|
|
10
|
|
98
|
use base 'Lingy::RT'; |
|
10
|
|
|
|
|
41
|
|
|
10
|
|
|
|
|
1547
|
|
6
|
|
|
|
|
|
|
|
7
|
10
|
|
|
10
|
|
3581
|
use YAMLScript; |
|
10
|
|
|
|
|
36
|
|
|
10
|
|
|
|
|
269
|
|
8
|
10
|
|
|
10
|
|
421
|
use YAMLScript::Common; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
2257
|
|
9
|
10
|
|
|
10
|
|
3765
|
use YAMLScript::Core; |
|
10
|
|
|
|
|
31
|
|
|
10
|
|
|
|
|
325
|
|
10
|
10
|
|
|
10
|
|
536
|
use YAMLScript::Reader; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
270
|
|
11
|
10
|
|
|
10
|
|
4385
|
use YAMLScript::ReadLine; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
313
|
|
12
|
|
|
|
|
|
|
|
13
|
10
|
|
|
10
|
|
70
|
use constant LANG => 'YAMLScript'; |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
558
|
|
14
|
10
|
|
|
10
|
|
67
|
use constant reader_class => 'YAMLScript::Reader'; |
|
10
|
|
|
|
|
28
|
|
|
10
|
|
|
|
|
494
|
|
15
|
10
|
|
|
10
|
|
61
|
use constant RL => YAMLScript::ReadLine->new; |
|
10
|
|
|
|
|
18
|
|
|
10
|
|
|
|
|
62
|
|
16
|
|
|
|
|
|
|
|
17
|
10
|
|
|
|
|
3756
|
use constant repl_intro_command => |
18
|
10
|
|
|
10
|
|
568
|
q<(println (str *LANG* " " (yamlscript-version) " [" *HOST* "]\n"))>; |
|
10
|
|
|
|
|
16
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub class_names { |
21
|
|
|
|
|
|
|
[ |
22
|
9
|
|
|
9
|
0
|
25
|
@{Lingy::RT::class_names()}, |
|
9
|
|
|
|
|
56
|
|
23
|
|
|
|
|
|
|
'Lingy::RT', |
24
|
|
|
|
|
|
|
'YAMLScript::Core', |
25
|
|
|
|
|
|
|
]; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $reader; |
29
|
1
|
|
|
1
|
0
|
999
|
sub reader { $reader } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub init { |
32
|
10
|
|
|
10
|
0
|
179
|
my $self = shift; |
33
|
10
|
|
|
|
|
133
|
$self->SUPER::init(@_); |
34
|
10
|
|
|
|
|
577
|
$reader = $self->require_new($self->reader_class); |
35
|
10
|
|
|
|
|
70
|
$self->rep(q< (use 'YAMLScript.Core) >); |
36
|
10
|
|
|
|
|
2056
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub core_namespace { |
40
|
10
|
|
|
10
|
0
|
32640
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
10
|
|
|
|
|
113
|
my $ns = $self->SUPER::core_namespace(@_); |
43
|
|
|
|
|
|
|
|
44
|
10
|
|
|
|
|
4223
|
$YAMLScript::VERSION =~ /^(\d+)\.(\d+)\.(\d+)$/; |
45
|
10
|
|
|
|
|
141
|
$self->rep(" |
46
|
|
|
|
|
|
|
(def *yamlscript-version* |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
:major $1 |
49
|
|
|
|
|
|
|
:minor $2 |
50
|
|
|
|
|
|
|
:incremental $3 |
51
|
|
|
|
|
|
|
:qualifier nil |
52
|
|
|
|
|
|
|
}) |
53
|
|
|
|
|
|
|
"); |
54
|
|
|
|
|
|
|
|
55
|
10
|
|
|
|
|
815
|
return $ns; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub is_lingy_class { |
59
|
1142
|
|
|
1142
|
0
|
2461
|
my ($self, $class) = @_; |
60
|
1142
|
50
|
|
|
|
9761
|
$class->isa(CLASS) or $class =~ /^(?:Lingy|YAMLScript)::\w/; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# TODO Find cleaner way to override 'require' to support .ys files. |
65
|
10
|
|
|
10
|
|
99
|
use Lingy::RT; |
|
10
|
|
|
|
|
43
|
|
|
10
|
|
|
|
|
372
|
|
66
|
|
|
|
|
|
|
package Lingy::RT; |
67
|
|
|
|
|
|
|
|
68
|
10
|
|
|
10
|
|
61
|
no warnings 'redefine'; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
4527
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub require { |
71
|
|
|
|
|
|
|
outer: |
72
|
10
|
|
|
10
|
0
|
736
|
for my $spec (@_) { |
73
|
10
|
50
|
|
|
|
63
|
err "'require' only works with symbols" |
74
|
|
|
|
|
|
|
unless ref($spec) eq SYMBOL; |
75
|
|
|
|
|
|
|
|
76
|
10
|
50
|
|
|
|
73
|
return nil if $Lingy::Main::ns{$$spec}; |
77
|
|
|
|
|
|
|
|
78
|
10
|
|
|
|
|
33
|
my $name = $$spec; |
79
|
|
|
|
|
|
|
|
80
|
10
|
|
|
|
|
25
|
my $path = $name; |
81
|
10
|
|
|
|
|
30
|
$path =~ s/^lingy\.lang\./Lingy./; |
82
|
10
|
|
|
|
|
27
|
$path =~ s/^lingy\./Lingy./; |
83
|
10
|
|
|
|
|
25
|
my $module = $path; |
84
|
10
|
|
|
|
|
52
|
$path =~ s/\./\//g; |
85
|
|
|
|
|
|
|
|
86
|
10
|
|
|
|
|
36
|
for my $inc (@INC) { |
87
|
11
|
|
|
|
|
89
|
$inc =~ s{^([^/.])}{./$1}; |
88
|
11
|
|
|
|
|
54
|
my $inc_path = "$inc/$path"; |
89
|
11
|
100
|
66
|
|
|
558
|
if (-f "$inc_path.ly" or |
90
|
|
|
|
|
|
|
-f "$inc_path.ys" |
91
|
|
|
|
|
|
|
) { |
92
|
10
|
50
|
|
|
|
169
|
if (-f "$inc_path.ly") { |
93
|
10
|
|
|
|
|
72
|
my $ns = RT->current_ns; |
94
|
10
|
|
|
|
|
81
|
RT->rep(qq< (load-file "$inc_path.ly") >); |
95
|
10
|
|
|
|
|
973
|
$ns->current; |
96
|
|
|
|
|
|
|
} |
97
|
10
|
50
|
|
|
|
339
|
if (-f "$inc_path.ys") { |
98
|
0
|
|
|
|
|
0
|
my $ns = RT->current_ns; |
99
|
0
|
|
|
|
|
0
|
RT->rep(qq< (load-file "$inc_path.ys") >); |
100
|
0
|
|
|
|
|
0
|
$ns->current; |
101
|
|
|
|
|
|
|
} |
102
|
10
|
|
|
|
|
98
|
next outer; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
} |
105
|
0
|
|
|
|
|
0
|
err "Can't find library for (require '$name)"; |
106
|
|
|
|
|
|
|
} |
107
|
10
|
|
|
|
|
54
|
return nil; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; |