line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JavaScript::Code::Number;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
72
|
|
4
|
2
|
|
|
2
|
|
11
|
use vars qw[ $VERSION ];
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
71
|
|
5
|
|
|
|
|
|
|
use base
|
6
|
2
|
|
|
2
|
|
9
|
qw[ JavaScript::Code::Type JavaScript::Code::Expression::Node::Arithmetic ];
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
381
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$VERSION = '0.08';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
JavaScript::Code::Number - A JavaScript Number Type
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#!/usr/bin/perl
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use strict;
|
19
|
|
|
|
|
|
|
use warnings;
|
20
|
|
|
|
|
|
|
use JavaScript::Code::Number;
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $number = JavaScript::Code::String->new( value => 42 );
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
print $number->output;
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 METHODS
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
See also the L documentation.
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 $self->type( )
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub type {
|
37
|
0
|
|
|
0
|
1
|
0
|
return "Number";
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 $self->output( )
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub output {
|
45
|
2
|
|
|
2
|
1
|
127
|
my ($self) = @_;
|
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
|
|
9
|
my $value = $self->value;
|
48
|
2
|
|
|
|
|
424
|
$value += 0; # make sure it is a number
|
49
|
|
|
|
|
|
|
|
50
|
2
|
|
|
|
|
6
|
return "$value";
|
51
|
|
|
|
|
|
|
}
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SEE ALSO
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
L
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 AUTHOR
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Sascha Kiefer, C
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 LICENSE
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under
|
64
|
|
|
|
|
|
|
the same terms as Perl itself.
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1;
|