line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# MathML::itex2MML |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright, Jacques Distler 2018-21. |
4
|
|
|
|
|
|
|
# All Rights Reserved. |
5
|
|
|
|
|
|
|
# Licensed under the Perl Artistic License. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
# Version: 1.6.1 |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package MathML::itex2MML; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
61452
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
12
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
4
|
use base qw(Exporter); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
144
|
|
15
|
1
|
|
|
1
|
|
7
|
use base qw(DynaLoader); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
530
|
|
16
|
|
|
|
|
|
|
our $VERSION = '1.6.1'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package MathML::itex2MMLc; |
19
|
|
|
|
|
|
|
bootstrap MathML::itex2MML; |
20
|
|
|
|
|
|
|
package MathML::itex2MML; |
21
|
|
|
|
|
|
|
our @EXPORT = qw(itex_html_filter itex_filter itex_inline_filter itex_block_filter); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# ---------- BASE METHODS ------------- |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
package MathML::itex2MML; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub itex_html_filter { |
28
|
1
|
|
|
1
|
0
|
81
|
my $text = shift(@_); |
29
|
1
|
|
|
|
|
101
|
itex2MML_html_filter($text, length($text)); |
30
|
1
|
|
|
|
|
12
|
return itex2MML_output(); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub itex_filter { |
34
|
1
|
|
|
1
|
0
|
3
|
my $text = shift(@_); |
35
|
1
|
|
|
|
|
55
|
itex2MML_filter($text, length($text)); |
36
|
1
|
|
|
|
|
11
|
return itex2MML_output(); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub itex_inline_filter { |
40
|
1
|
|
|
1
|
0
|
3
|
my $text = shift(@_); |
41
|
1
|
|
|
|
|
29
|
itex2MML_filter('$' . $text . '$', length($text) + 2); |
42
|
1
|
|
|
|
|
8
|
return itex2MML_output(); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub itex_block_filter { |
46
|
1
|
|
|
1
|
0
|
2
|
my $text = shift(@_); |
47
|
1
|
|
|
|
|
37
|
itex2MML_filter('$$' . $text . '$$', length($text) + 4); |
48
|
1
|
|
|
|
|
10
|
return itex2MML_output(); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub TIEHASH { |
52
|
0
|
|
|
0
|
|
|
my ($classname,$obj) = @_; |
53
|
0
|
|
|
|
|
|
return bless $obj, $classname; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
0
|
|
|
sub CLEAR { } |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
0
|
|
|
sub FIRSTKEY { } |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
0
|
|
|
sub NEXTKEY { } |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub FETCH { |
63
|
0
|
|
|
0
|
|
|
my ($self,$field) = @_; |
64
|
0
|
|
|
|
|
|
my $member_func = "swig_${field}_get"; |
65
|
0
|
|
|
|
|
|
$self->$member_func(); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub STORE { |
69
|
0
|
|
|
0
|
|
|
my ($self,$field,$newval) = @_; |
70
|
0
|
|
|
|
|
|
my $member_func = "swig_${field}_set"; |
71
|
0
|
|
|
|
|
|
$self->$member_func($newval); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub this { |
75
|
0
|
|
|
0
|
0
|
|
my $ptr = shift; |
76
|
0
|
|
|
|
|
|
return tied(%$ptr); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# ------- FUNCTION WRAPPERS -------- |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
package MathML::itex2MML; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
*itex2MML_filter = *MathML::itex2MMLc::itex2MML_filter; |
85
|
|
|
|
|
|
|
*itex2MML_html_filter = *MathML::itex2MMLc::itex2MML_html_filter; |
86
|
|
|
|
|
|
|
*itex2MML_output = *MathML::itex2MMLc::itex2MML_output; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# ------- VARIABLE STUBS -------- |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
package MathML::itex2MML; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |
93
|
|
|
|
|
|
|
__END__ |