line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CljPerl::Atom;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict;
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
51
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings;
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
8
|
use CljPerl::Printer;
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
30
|
|
7
|
2
|
|
|
2
|
|
7
|
use CljPerl::Logger;
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
1066
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.10';
|
10
|
|
|
|
|
|
|
our $id = 0;
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new {
|
13
|
0
|
|
|
0
|
0
|
|
my $class = shift;
|
14
|
0
|
|
|
|
|
|
my $type = shift;
|
15
|
0
|
|
|
|
|
|
my $value = shift;
|
16
|
0
|
0
|
|
|
|
|
$value = "" if !defined $value;
|
17
|
0
|
|
|
|
|
|
my $self = {class=>"Atom",
|
18
|
|
|
|
|
|
|
type=>$type,
|
19
|
|
|
|
|
|
|
value=>$value,
|
20
|
|
|
|
|
|
|
object_id=>"atom" . ($id++),
|
21
|
|
|
|
|
|
|
meta=>undef,
|
22
|
|
|
|
|
|
|
pos=>{filename=>"unknown",
|
23
|
|
|
|
|
|
|
line=>0,
|
24
|
|
|
|
|
|
|
col=>0}};
|
25
|
0
|
|
|
|
|
|
bless $self;
|
26
|
0
|
|
|
|
|
|
return $self;
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub class {
|
30
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
31
|
0
|
|
|
|
|
|
return $self->{class};
|
32
|
|
|
|
|
|
|
}
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub type {
|
35
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
36
|
0
|
|
|
|
|
|
my $type = shift;
|
37
|
0
|
0
|
|
|
|
|
if(defined $type) {
|
38
|
0
|
|
|
|
|
|
$self->{type} = $type;
|
39
|
|
|
|
|
|
|
} else {
|
40
|
0
|
|
|
|
|
|
return $self->{type};
|
41
|
|
|
|
|
|
|
}
|
42
|
|
|
|
|
|
|
}
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub object_id {
|
45
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
46
|
0
|
|
|
|
|
|
return $self->{object_id};
|
47
|
|
|
|
|
|
|
}
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub meta {
|
50
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
51
|
0
|
|
|
|
|
|
my $meta = shift;
|
52
|
0
|
0
|
|
|
|
|
if(defined $meta) {
|
53
|
0
|
|
|
|
|
|
$self->{meta} = $meta;
|
54
|
|
|
|
|
|
|
} else {
|
55
|
0
|
|
|
|
|
|
return $self->{meta};
|
56
|
|
|
|
|
|
|
}
|
57
|
|
|
|
|
|
|
}
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub value {
|
60
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
61
|
0
|
|
|
|
|
|
my $value = shift;
|
62
|
0
|
0
|
|
|
|
|
if(defined $value) {
|
63
|
0
|
|
|
|
|
|
$self->{value} = $value;
|
64
|
|
|
|
|
|
|
} else {
|
65
|
0
|
|
|
|
|
|
return $self->{value};
|
66
|
|
|
|
|
|
|
}
|
67
|
|
|
|
|
|
|
}
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub show {
|
70
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
71
|
0
|
|
|
|
|
|
my $indent = shift;
|
72
|
0
|
0
|
|
|
|
|
$indent = "" if !defined $indent;
|
73
|
|
|
|
|
|
|
#print $indent . "class: " . $self->{class} . "\n";
|
74
|
0
|
|
|
|
|
|
print $indent . "type: " . $self->{type} . "\n";
|
75
|
0
|
|
|
|
|
|
print $indent . "value: " . $self->{value} . "\n";
|
76
|
|
|
|
|
|
|
}
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub error {
|
79
|
0
|
|
|
0
|
0
|
|
my $self = shift;
|
80
|
0
|
|
|
|
|
|
my $msg = shift;
|
81
|
0
|
|
|
|
|
|
$msg .= " [";
|
82
|
0
|
|
|
|
|
|
$msg .= CljPerl::Printer::to_string($self);
|
83
|
0
|
|
|
|
|
|
$msg .= "] @[file: " . $self->{pos}->{filename};
|
84
|
0
|
|
|
|
|
|
$msg .= " ;line: " . $self->{pos}->{line};
|
85
|
0
|
|
|
|
|
|
$msg .= " ;col: " . $self->{pos}->{col} . "]";
|
86
|
0
|
|
|
|
|
|
CljPerl::Logger::error($msg);
|
87
|
|
|
|
|
|
|
}
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
1;
|
90
|
|
|
|
|
|
|
|