| 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 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 1 | ▶ | use base qw(Exporter); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 1 | ▶ | use base qw(DynaLoader); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 1 | our $VERSION = '1.6.1'; | |
| 17 | |||
| 18 | package MathML::itex2MMLc; | ||
| 19 | 1 | bootstrap MathML::itex2MML; | |
| 20 | package MathML::itex2MML; | ||
| 21 | 1 | 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 | 1 | ▶ | sub itex_html_filter { |
|
Subroutine
itex_html_filter: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 28 | 1 | my $text = shift(@_); | |
| 29 | 1 | itex2MML_html_filter($text, length($text)); | |
| 30 | 1 | return itex2MML_output(); | |
| 31 | } | ||
| 32 | |||
| 33 | 1 | ▶ | sub itex_filter { |
|
Subroutine
itex_filter: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 34 | 1 | my $text = shift(@_); | |
| 35 | 1 | itex2MML_filter($text, length($text)); | |
| 36 | 1 | return itex2MML_output(); | |
| 37 | } | ||
| 38 | |||
| 39 | 1 | ▶ | sub itex_inline_filter { |
|
Subroutine
itex_inline_filter: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 40 | 1 | my $text = shift(@_); | |
| 41 | 1 | itex2MML_filter('$' . $text . '$', length($text) + 2); | |
| 42 | 1 | return itex2MML_output(); | |
| 43 | } | ||
| 44 | |||
| 45 | 1 | ▶ | sub itex_block_filter { |
|
Subroutine
itex_block_filter: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 46 | 1 | my $text = shift(@_); | |
| 47 | 1 | itex2MML_filter('$$' . $text . '$$', length($text) + 4); | |
| 48 | 1 | return itex2MML_output(); | |
| 49 | } | ||
| 50 | |||
| 51 | 0 | ▶ | sub TIEHASH { |
|
Subroutine
TIEHASH: not called CC=1 SCAR=6.9
| |||
| 52 | 0 | my ($classname,$obj) = @_; | |
| 53 | 0 | return bless $obj, $classname; | |
| 54 | } | ||
| 55 | |||
| 56 | 0 | ▶ | sub CLEAR { } |
|
Subroutine
CLEAR: not called CC=1 SCAR=0.0
| |||
| 57 | |||
| 58 | 0 | ▶ | sub FIRSTKEY { } |
|
Subroutine
FIRSTKEY: not called CC=1 SCAR=0.0
| |||
| 59 | |||
| 60 | 0 | ▶ | sub NEXTKEY { } |
|
Subroutine
NEXTKEY: not called CC=1 SCAR=0.0
| |||
| 61 | |||
| 62 | 0 | ▶ | sub FETCH { |
|
Subroutine
FETCH: not called CC=1 SCAR=6.9
| |||
| 63 | 0 | my ($self,$field) = @_; | |
| 64 | 0 | my $member_func = "swig_${field}_get"; | |
| 65 | 0 | $self->$member_func(); | |
| 66 | } | ||
| 67 | |||
| 68 | 0 | ▶ | sub STORE { |
|
Subroutine
STORE: not called CC=1 SCAR=6.9
| |||
| 69 | 0 | my ($self,$field,$newval) = @_; | |
| 70 | 0 | my $member_func = "swig_${field}_set"; | |
| 71 | 0 | $self->$member_func($newval); | |
| 72 | } | ||
| 73 | |||
| 74 | 0 | ▶ | sub this { |
|
Subroutine
this: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 75 | 0 | my $ptr = shift; | |
| 76 | 0 | return tied(%$ptr); | |
| 77 | } | ||
| 78 | |||
| 79 | |||
| 80 | # ------- FUNCTION WRAPPERS -------- | ||
| 81 | |||
| 82 | package MathML::itex2MML; | ||
| 83 | |||
| 84 | 1 | *itex2MML_filter = *MathML::itex2MMLc::itex2MML_filter; | |
| 85 | 1 | *itex2MML_html_filter = *MathML::itex2MMLc::itex2MML_html_filter; | |
| 86 | 1 | *itex2MML_output = *MathML::itex2MMLc::itex2MML_output; | |
| 87 | |||
| 88 | # ------- VARIABLE STUBS -------- | ||
| 89 | |||
| 90 | package MathML::itex2MML; | ||
| 91 | |||
| 92 | 1 | 1; | |
| 93 | __END__ | ||