line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Language::Expr::Interpreter::Base; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $DATE = '2016-07-01'; # DATE |
4
|
|
|
|
|
|
|
our $VERSION = '0.28'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1603
|
use 5.010; |
|
4
|
|
|
|
|
11
|
|
7
|
4
|
|
|
4
|
|
13
|
use strict; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
64
|
|
8
|
4
|
|
|
4
|
|
10
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
315
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
require Language::Expr::Parser; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
2
|
|
|
2
|
1
|
2
|
my $class = shift; |
14
|
2
|
|
|
|
|
9
|
bless {}, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub eval { |
18
|
167
|
|
|
167
|
1
|
75609
|
my ($self, $expr) = @_; |
19
|
167
|
|
|
|
|
367
|
my $res = Language::Expr::Parser::parse_expr($expr, $self); |
20
|
140
|
|
|
|
|
467
|
$res; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
# ABSTRACT: Base class for Language::Expr interpreters |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=pod |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=encoding UTF-8 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Language::Expr::Interpreter::Base - Base class for Language::Expr interpreters |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 VERSION |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
This document describes version 0.28 of Language::Expr::Interpreter::Base (from Perl distribution Language-Expr), released on 2016-07-01. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 new() |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 eval($expr) => $result |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Evaluate expression and return the result. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 HOMEPAGE |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Please visit the project's homepage at L<https://metacpan.org/release/Language-Expr>. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 SOURCE |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Source repository is at L<https://github.com/perlancar/perl-Language-Expr>. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 BUGS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Language-Expr> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
61
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
62
|
|
|
|
|
|
|
feature. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
perlancar <perlancar@cpan.org> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This software is copyright (c) 2016 by perlancar@cpan.org. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
73
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |