line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
11
|
|
|
11
|
|
84
|
use strict; use warnings; |
|
11
|
|
|
11
|
|
25
|
|
|
11
|
|
|
|
|
357
|
|
|
11
|
|
|
|
|
61
|
|
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
411
|
|
2
|
|
|
|
|
|
|
package YAMLScript::RT; |
3
|
|
|
|
|
|
|
|
4
|
11
|
|
|
11
|
|
5038
|
use Lingy::RT; |
|
11
|
|
|
|
|
20707
|
|
|
11
|
|
|
|
|
387
|
|
5
|
11
|
|
|
11
|
|
94
|
use base 'Lingy::RT'; |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
1515
|
|
6
|
|
|
|
|
|
|
|
7
|
11
|
|
|
11
|
|
3822
|
use YAMLScript; |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
294
|
|
8
|
11
|
|
|
11
|
|
415
|
use YAMLScript::Common; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
2685
|
|
9
|
11
|
|
|
11
|
|
4292
|
use YAMLScript::Core; |
|
11
|
|
|
|
|
31
|
|
|
11
|
|
|
|
|
312
|
|
10
|
11
|
|
|
11
|
|
573
|
use YAMLScript::Reader; |
|
11
|
|
|
|
|
26
|
|
|
11
|
|
|
|
|
262
|
|
11
|
11
|
|
|
11
|
|
4618
|
use YAMLScript::ReadLine; |
|
11
|
|
|
|
|
39
|
|
|
11
|
|
|
|
|
339
|
|
12
|
|
|
|
|
|
|
|
13
|
11
|
|
|
11
|
|
67
|
use constant LANG => 'YAMLScript'; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
630
|
|
14
|
11
|
|
|
11
|
|
65
|
use constant reader_class => 'YAMLScript::Reader'; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
727
|
|
15
|
11
|
|
|
11
|
|
65
|
use constant RL => YAMLScript::ReadLine->new; |
|
11
|
|
|
|
|
29
|
|
|
11
|
|
|
|
|
61
|
|
16
|
|
|
|
|
|
|
|
17
|
11
|
|
|
|
|
3926
|
use constant repl_intro_command => |
18
|
11
|
|
|
11
|
|
605
|
q<(println (str *LANG* " " (yamlscript-version) " [" *HOST* "]\n"))>; |
|
11
|
|
|
|
|
22
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub class_names { |
21
|
|
|
|
|
|
|
[ |
22
|
10
|
|
|
10
|
0
|
29
|
@{Lingy::RT::class_names()}, |
|
10
|
|
|
|
|
42
|
|
23
|
|
|
|
|
|
|
'Lingy::RT', |
24
|
|
|
|
|
|
|
'YAMLScript::Core', |
25
|
|
|
|
|
|
|
]; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $reader; |
29
|
1
|
|
|
1
|
0
|
1071
|
sub reader { $reader } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub init { |
32
|
11
|
|
|
11
|
0
|
185
|
my $self = shift; |
33
|
11
|
|
|
|
|
190
|
$self->SUPER::init(@_); |
34
|
11
|
|
|
|
|
499
|
$reader = $self->require_new($self->reader_class); |
35
|
11
|
|
|
|
|
63
|
$self->rep(q< (use 'YAMLScript.Core) >); |
36
|
11
|
|
|
|
|
2622
|
return $self; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub core_namespace { |
40
|
11
|
|
|
11
|
0
|
35952
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
11
|
|
|
|
|
108
|
my $ns = $self->SUPER::core_namespace(@_); |
43
|
|
|
|
|
|
|
|
44
|
11
|
|
|
|
|
4790
|
$YAMLScript::VERSION =~ /^(\d+)\.(\d+)\.(\d+)$/; |
45
|
11
|
|
|
|
|
145
|
$self->rep(" |
46
|
|
|
|
|
|
|
(def *yamlscript-version* |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
:major $1 |
49
|
|
|
|
|
|
|
:minor $2 |
50
|
|
|
|
|
|
|
:incremental $3 |
51
|
|
|
|
|
|
|
:qualifier nil |
52
|
|
|
|
|
|
|
}) |
53
|
|
|
|
|
|
|
"); |
54
|
|
|
|
|
|
|
|
55
|
11
|
|
|
|
|
873
|
return $ns; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub is_lingy_class { |
59
|
1298
|
|
|
1298
|
0
|
2757
|
my ($self, $class) = @_; |
60
|
1298
|
50
|
|
|
|
10994
|
$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
|
|
266
|
use Lingy::RT; |
|
11
|
|
|
|
|
36
|
|
|
11
|
|
|
|
|
454
|
|
66
|
|
|
|
|
|
|
package Lingy::RT; |
67
|
|
|
|
|
|
|
|
68
|
11
|
|
|
11
|
|
66
|
no warnings 'redefine'; |
|
11
|
|
|
|
|
30
|
|
|
11
|
|
|
|
|
5194
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub require { |
71
|
|
|
|
|
|
|
outer: |
72
|
11
|
|
|
11
|
0
|
759
|
for my $spec (@_) { |
73
|
11
|
50
|
|
|
|
63
|
err "'require' only works with symbols" |
74
|
|
|
|
|
|
|
unless ref($spec) eq SYMBOL; |
75
|
|
|
|
|
|
|
|
76
|
11
|
50
|
|
|
|
63
|
return nil if $Lingy::Main::ns{$$spec}; |
77
|
|
|
|
|
|
|
|
78
|
11
|
|
|
|
|
32
|
my $name = $$spec; |
79
|
|
|
|
|
|
|
|
80
|
11
|
|
|
|
|
26
|
my $path = $name; |
81
|
11
|
|
|
|
|
42
|
$path =~ s/^lingy\.lang\./Lingy./; |
82
|
11
|
|
|
|
|
30
|
$path =~ s/^lingy\./Lingy./; |
83
|
11
|
|
|
|
|
29
|
$path =~ s/^ys\./YAMLScript./; |
84
|
11
|
|
|
|
|
26
|
my $module = $path; |
85
|
11
|
|
|
|
|
59
|
$path =~ s/\./\//g; |
86
|
|
|
|
|
|
|
|
87
|
11
|
|
|
|
|
52
|
for my $inc (@INC) { |
88
|
12
|
|
|
|
|
93
|
$inc =~ s{^([^/.])}{./$1}; |
89
|
12
|
|
|
|
|
50
|
my $inc_path = "$inc/$path"; |
90
|
12
|
100
|
66
|
|
|
596
|
if (-f "$inc_path.ly" or |
91
|
|
|
|
|
|
|
-f "$inc_path.ys" |
92
|
|
|
|
|
|
|
) { |
93
|
11
|
50
|
|
|
|
204
|
if (-f "$inc_path.ly") { |
94
|
11
|
|
|
|
|
81
|
my $ns = RT->current_ns; |
95
|
11
|
|
|
|
|
92
|
RT->rep(qq< (load-file "$inc_path.ly") >); |
96
|
11
|
|
|
|
|
1074
|
$ns->current; |
97
|
|
|
|
|
|
|
} |
98
|
11
|
50
|
|
|
|
375
|
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
|
|
|
|
|
97
|
next outer; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
} |
106
|
0
|
|
|
|
|
0
|
err "Can't find library for (require '$name)"; |
107
|
|
|
|
|
|
|
} |
108
|
11
|
|
|
|
|
69
|
return nil; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
1; |