| 1 | # /=====================================================================\ # | ||||||||||
| 2 | # | LaTeXML::Core::Definition::CharDef | # | ||||||||||
| 3 | # | Representation of definitions of Control Sequences | # | ||||||||||
| 4 | # |=====================================================================| # | ||||||||||
| 5 | # | Part of LaTeXML: | # | ||||||||||
| 6 | # | Public domain software, produced as part of work done by the | # | ||||||||||
| 7 | # | United States Government & not subject to copyright in the US. | # | ||||||||||
| 8 | # |---------------------------------------------------------------------| # | ||||||||||
| 9 | # | Bruce Miller <bruce.miller@nist.gov> #_# | # | ||||||||||
| 10 | # | http://dlmf.nist.gov/LaTeXML/ (o o) | # | ||||||||||
| 11 | # \=========================================================ooo==U==ooo=/ # | ||||||||||
| 12 | package LaTeXML::Core::Definition::CharDef; | ||||||||||
| 13 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 4 | ▶ | use LaTeXML::Global; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 4 | ▶ | use LaTeXML::Common::Error; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 4 | ▶ | use base qw(LaTeXML::Core::Definition::Register); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | # A CharDef is a specialized register; | ||||||||||
| 20 | # You can't assign it; when you invoke the control sequence, it returns | ||||||||||
| 21 | # the result of evaluating the character (more like a regular primitive). | ||||||||||
| 22 | |||||||||||
| 23 | sub new { | ||||||||||
| 24 | 0 | ▶ | my ($class, $cs, $value, $internalcs, %traits) = @_; | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 25 | 0 | return bless { cs => $cs, parameters => undef, | |||||||||
| 26 | value => $value, internalcs => $internalcs, | ||||||||||
| 27 | registerType => 'Number', readonly => 1, | ||||||||||
| 28 | locator => $STATE->getStomach->getGullet->getLocator, | ||||||||||
| 29 | %traits }, $class; } | ||||||||||
| 30 | |||||||||||
| 31 | sub valueOf { | ||||||||||
| 32 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
valueOf: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 33 | 0 | return $$self{value}; } | |||||||||
| 34 | |||||||||||
| 35 | sub setValue { | ||||||||||
| 36 | 0 | ▶ | my ($self, $value) = @_; | ||||||||
|
Subroutine
setValue: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 37 | 0 | Error('unexpected', $self, undef, "Can't assign to chardef " . $self->getCSName); | |||||||||
| 38 | 0 | return; } | |||||||||
| 39 | |||||||||||
| 40 | sub invoke { | ||||||||||
| 41 | 0 | ▶ | my ($self, $stomach) = @_; | ||||||||
|
Subroutine
invoke: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 42 | 0 | my $cs = $$self{internalcs}; | |||||||||
| 43 | # Tracing ? | ||||||||||
| 44 | 0 | ▶ | return (defined $cs ? $stomach->invokeToken($cs) : undef); } | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | |||||||||||
| 46 | #=============================================================================== | ||||||||||
| 47 | 4 | 1; | |||||||||
| 48 | |||||||||||
| 49 | __END__ | ||||||||||