Skip to content

Commit

Permalink
[WiP] Tex pool reorg (#2358)
Browse files Browse the repository at this point in the history
* A slightly more efficient kpse cache scan
* Move all pool files to LaTeXML/Engine; have LoadPool look there for pools; move and rename all pool-level modules
* Split TeX.pool into modules related to control-sequence family, LaTeXML-specific support and a binding for plain.tex
  • Loading branch information
brucemiller authored Apr 26, 2024
1 parent fcfe73d commit 3b753cf
Show file tree
Hide file tree
Showing 38 changed files with 9,220 additions and 7,873 deletions.
43 changes: 36 additions & 7 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,51 @@ lib/LaTeXML/resources/Profiles/math.opt
lib/LaTeXML/resources/Profiles/modern.opt
lib/LaTeXML/resources/Profiles/standard.opt

#==================================================
# Supported Engines/Formats
#==================================================
lib/LaTeXML/Engine/AmSTeX.pool.ltxml
lib/LaTeXML/Engine/BibTeX.pool.ltxml
lib/LaTeXML/Engine/Base_Schema.pool.ltxml
lib/LaTeXML/Engine/Base_ParameterTypes.pool.ltxml
lib/LaTeXML/Engine/Base_XMath.pool.ltxml
lib/LaTeXML/Engine/Base_Utility.pool.ltxml
lib/LaTeXML/Engine/Base_Deprecated.pool.ltxml
lib/LaTeXML/Engine/TeX.pool.ltxml
lib/LaTeXML/Engine/TeX_Box.pool.ltxml
lib/LaTeXML/Engine/TeX_Character.pool.ltxml
lib/LaTeXML/Engine/TeX_Debugging.pool.ltxml
lib/LaTeXML/Engine/TeX_FileIO.pool.ltxml
lib/LaTeXML/Engine/TeX_Fonts.pool.ltxml
lib/LaTeXML/Engine/TeX_Glue.pool.ltxml
lib/LaTeXML/Engine/TeX_Hyphenation.pool.ltxml
lib/LaTeXML/Engine/TeX_Inserts.pool.ltxml
lib/LaTeXML/Engine/TeX_Job.pool.ltxml
lib/LaTeXML/Engine/TeX_Kern.pool.ltxml
lib/LaTeXML/Engine/TeX_Logic.pool.ltxml
lib/LaTeXML/Engine/TeX_Macro.pool.ltxml
lib/LaTeXML/Engine/TeX_Marks.pool.ltxml
lib/LaTeXML/Engine/TeX_Math.pool.ltxml
lib/LaTeXML/Engine/TeX_Page.pool.ltxml
lib/LaTeXML/Engine/TeX_Paragraph.pool.ltxml
lib/LaTeXML/Engine/TeX_Penalties.pool.ltxml
lib/LaTeXML/Engine/TeX_Registers.pool.ltxml
lib/LaTeXML/Engine/TeX_Tables.pool.ltxml
lib/LaTeXML/Engine/plain.pool.ltxml
lib/LaTeXML/Engine/LaTeX.pool.ltxml
lib/LaTeXML/Engine/eTeX.pool.ltxml
lib/LaTeXML/Engine/expl3.pool.ltxml
lib/LaTeXML/Engine/pdfTeX.pool.ltxml

#==================================================
# Supported Packages
#==================================================
lib/LaTeXML/Package.pm
lib/LaTeXML/Package/AmSTeX.pool.ltxml
lib/LaTeXML/Package/BibTeX.pool.ltxml
lib/LaTeXML/Package/JHEP.cls.ltxml
lib/LaTeXML/Package/JHEP2.cls.ltxml
lib/LaTeXML/Package/JHEP3.cls.ltxml
lib/LaTeXML/Package/LaTeX.pool.ltxml
lib/LaTeXML/Package/OmniBus.cls.ltxml
lib/LaTeXML/Package/PoS.cls.ltxml
lib/LaTeXML/Package/TeX.pool.ltxml
lib/LaTeXML/Package/a0poster.cls.ltxml
lib/LaTeXML/Package/a0size.sty.ltxml
lib/LaTeXML/Package/a4.sty.ltxml
Expand Down Expand Up @@ -449,7 +481,6 @@ lib/LaTeXML/Package/dsfont.sty.ltxml
lib/LaTeXML/Package/empheq.sty.ltxml
lib/LaTeXML/Package/endnotes.sty.ltxml
lib/LaTeXML/Package/english.sty.ltxml
lib/LaTeXML/Package/eTeX.pool.ltxml
lib/LaTeXML/Package/ellipsis.sty.ltxml
lib/LaTeXML/Package/elsart.cls.ltxml
lib/LaTeXML/Package/elsart.sty.ltxml
Expand All @@ -460,7 +491,6 @@ lib/LaTeXML/Package/ed.sty.ltxml
lib/LaTeXML/Package/expl3.sty.ltxml
lib/LaTeXML/Package/expl3.ltx.ltxml
lib/LaTeXML/Package/expl3.lua.ltxml
lib/LaTeXML/Package/expl3.pool.ltxml
lib/LaTeXML/Package/emulateapj.cls.ltxml
lib/LaTeXML/Package/emulateapj.sty.ltxml
lib/LaTeXML/Package/emulateapj5.sty.ltxml
Expand Down Expand Up @@ -623,7 +653,6 @@ lib/LaTeXML/Package/overpic.sty.ltxml
lib/LaTeXML/Package/palatino.sty.ltxml
lib/LaTeXML/Package/paralist.sty.ltxml
lib/LaTeXML/Package/parskip.sty.ltxml
lib/LaTeXML/Package/pdfTeX.pool.ltxml
lib/LaTeXML/Package/pdflscape.sty.ltxml
lib/LaTeXML/Package/pdfpages.sty.ltxml
lib/LaTeXML/Package/pdfsync.sty.ltxml
Expand Down
1 change: 1 addition & 0 deletions lib/LaTeXML/Core.pm
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ sub initializeState {
$preload .= '.' . $type;
}
LaTeXML::Package::InputDefinitions($preload, type => $type,
($type eq 'pool' ? (installation_subdir => 'Engine') : ()),
handleoptions => $handleoptions, options => $options);
}
$state->assignValue('InitialPreloads' => undef, 'global');
Expand Down
2 changes: 1 addition & 1 deletion lib/LaTeXML/Core/Stomach.pm
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ INVOKE:

sub makeMisdefinedError {
my (@objects) = @_;
return LaTeXML::Core::Whatsit->new($STATE->lookupDefinition(T_CS('\@ERROR')),
return LaTeXML::Core::Whatsit->new($STATE->lookupDefinition(T_CS('\lx@ERROR')),
['misdefined', join('', map { ToString($_); } @objects)],
font => $STATE->lookupValue('font'),
); }
Expand Down
File renamed without changes.
95 changes: 95 additions & 0 deletions lib/LaTeXML/Engine/Base_Deprecated.pool.ltxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# -*- mode: Perl -*-
# /=====================================================================\ #
# | Base_Deprecated | #
# | Core TeX Implementation for LaTeXML | #
# |=====================================================================| #
# | Part of LaTeXML: | #
# | Public domain software, produced as part of work done by the | #
# | United States Government & not subject to copyright in the US. | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <[email protected]> #_# | #
# | http://dlmf.nist.gov/LaTeXML/ (o o) | #
# \=========================================================ooo==U==ooo=/ #
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sub Deprecate {
my ($source, $deprecated, $better) = @_;
# Eventually, just Warn; and in fact, Warn ONCE only
$deprecated = ToString($deprecated);
if (!LookupMapping('DEPRECATED', $deprecated)) {
AssignMapping('DEPRECATED', $deprecated => 1);
Warn('deprecated', $deprecated, $source,
"The command $deprecated has been deprecated; Please use " . ToString($better)); }
return; }

DefMacro('\lx@DEPRECATE{}{}', \&Deprecate);

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

DefMacro('\@ERROR',
'\lx@DEPRECATE{\@ERROR}{\lx@ERROR}\lx@ERROR');

DefMacro('\normal@par',
'\lx@DEPRECATE{\normnal@par}{\lx@normal@par}\lx@normal@par');
DefMacro('\inner@par',
'\lx@DEPRECATE{\inner@par}{\lx@normal@par}\lx@normal@par'); # Obsolete, but in case still used...

#----------------------------------------------------------------------
# This group should be renamed to \lx@somethings and deprecated
# NOTE: work through this systematically!
DefMacro('\FCN{}',
'\lx@DEPRECATE{\Fcn}{\lx@wrap}{\lx@wrap[role=FUNCTION]{#1}');
DefMacro('\ROLE{}{}',
'\lx@DEPRECATE{\ROLE}{\lx@wrap}\lx@wrap[role={#1}]{#2}');
DefMacro('\@SYMBOL{}',
'\lx@DEPRECATE{\@SYMBOL}{\lx@wrap}\lx@wrap[role=ID]{#1}');
DefMacro('\@CSYMBOL{}',
'\lx@DEPRECATE{\@CSYMBOL}{\lx@symbol}\lx@symbol[meaning={#1}]{}');
DefMacro('\@APPLY{}',
'\lx@DEPRECATE{\@APPLY}{\lx@apply}\lx@apply[]{#1}{}'); # Sorta broken?
DefMacro('\@MAYBEAPPLY{}{}',
'\lx@DEPRECATE{\@MAYBEAPPLY}{\lx@apply}\ifx.#2.#1\else\lx@apply{#1}{#2}\fi');
DefMacro('\@WRAP{}',
'\lx@DEPRECATE{\@WRAP}{\lx@wrap}\lx@wrap[]{#1}');
DefMacro('\@TOKEN{}',
'\lx@DEPRECATE{\@TOKEN}{\lx@symbol}\lx@symbol[name={#1}]{}');
DefMacro('\@SUPERSCRIPT{}{}',
'\lx@DEPRECATE{\@SUPERSCRIPT}{\lx@superscipt}\ifx.#2.#1\else\lx@superscript[]{#1}{#2}\fi');
DefMacro('\@SUBSCRIPT{}{}',
'\lx@DEPRECATE{\@SUBSCRIPT}{\lx@subscript}\ifx.#2.#1\else\lx@subscript[]{#1}{#2}\fi');
# Let('\@PADDED', '\lx@padded');
# Let('\DUAL', '\lx@dual');
# Let('\@XMArg', '\lx@xmarg');
# Let('\@XMRef', '\lx@xmref');
# Let('\@APPLYFUNCTION', '\lx@ApplyFunction');
# Let('\@INVISIBLETIMES', '\lx@InvisibleTimes');
# Let('\@INVISIBLECOMMA', '\lx@InvisibleComma');
# Let('\@INVISIBLEPLUS', '\lx@InvisiblePlus');

DefMacro('\@PADDED',
'\lx@DEPRECATE{\@PADDED}{\lx@padded}\lx@padded');
DefMacro('\DUAL',
'\lx@DEPRECATE{\DUAL}{\lx@dual}\lx@dual');
DefMacro('\@XMArg',
'\lx@DEPRECATE{\@XMArg}{\lx@xmarg}\lx@xmarg');
DefMacro('\@XMRef',
'\lx@DEPRECATE{\@XMRef}{\lx@xmref}\lx@xmref');
DefMacro('\@APPLYFUNCTION',
'\lx@DEPRECATE{\@APPLYFUNCTION}{\lx@ApplyFunction}\lx@ApplyFunction');
DefMacro('\@INVISIBLETIMES',
'\lx@DEPRECATE{\@INVISIBLETIMES}{\lx@InvisibleTimes}\lx@InvisibleTimes');
DefMacro('\@INVISIBLECOMMA',
'\lx@DEPRECATE{\@INVISIBLECOMMA}{\lx@InvisibleComma}\lx@InvisibleComma');
DefMacro('\@INVISIBLEPLUS',
'\lx@DEPRECATE{\@INVISIBLEPLUS}{\lx@InvisiblePlus}\lx@InvisiblePlus');

# End of stuff to be deprecated.
#----------------------------------------------------------------------

#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1;

Loading

0 comments on commit 3b753cf

Please sign in to comment.