summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexbase
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-10-01 22:00:41 +0000
committerKarl Berry <karl@freefriends.org>2015-10-01 22:00:41 +0000
commit79239bc6a14e7f5723e2027696b349d1f8cc11c9 (patch)
treec0fc4d14c1daff976ee0b83464f29fd733fe1b52 /Master/texmf-dist/tex/luatex/luatexbase
parentb0a27fa1b235b8769c32d6a4af90697503bc5f7f (diff)
luatexbase (1oct15)
git-svn-id: svn://tug.org/texlive/trunk@38513 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexbase')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/attr.lua223
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/cctb.lua41
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty119
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty252
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase-compat.sty143
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase-loader.sty100
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase-mcb.sty92
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase-modutils.sty142
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase-regs.sty195
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase.loader.lua65
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/luatexbase.sty363
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/mcb.lua313
-rw-r--r--Master/texmf-dist/tex/luatex/luatexbase/modutils.lua150
13 files changed, 350 insertions, 1848 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/attr.lua b/Master/texmf-dist/tex/luatex/luatexbase/attr.lua
deleted file mode 100644
index e86bbdedfda..00000000000
--- a/Master/texmf-dist/tex/luatex/luatexbase/attr.lua
+++ /dev/null
@@ -1,223 +0,0 @@
---
--- This is file `attr.lua',
--- generated with the docstrip utility.
---
--- The original source files were:
---
--- luatexbase-attr.dtx (with options: `luamodule')
---
--- See the aforementioned source file(s) for copyright and licensing information.
---
---- locals
-local copynode = node.copy
-local newnode = node.new
-local nodesubtype = node.subtype
-local nodetype = node.id
-local stringfind = string.find
-local stringformat = string.format
-local tableunpack = unpack or table.unpack
-local texiowrite_nl = texio.write_nl
-local texiowrite = texio.write
---- luatex internal types
-local whatsit_t = nodetype"whatsit"
-local user_defined_t = nodesubtype"user_defined"
-local unassociated = "__unassociated"
-luatexbase = luatexbase or { }
-local luatexbase = luatexbase
-local err, warning, info, log = luatexbase.provides_module({
- name = "luatexbase-attr",
- version = 0.6,
- date = "2013/05/11",
- description = "Attributes allocation for LuaTeX",
- author = "Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang",
- copyright = "Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang",
- license = "CC0",
-})
-luatexbase.attributes = luatexbase.attributes or { }
-local attributes = luatexbase.attributes
-local new_attribute
-local unset_attribute
-local luatex_sty_counter = 'LuT@AllocAttribute'
-if tex.count[luatex_sty_counter] then
- if tex.count[luatex_sty_counter] > -1 then
- error("luatexbase error: attribute 0 has already been set by \newattribute"
- .."macro from luatex.sty, not belonging to this package, this makes"
- .."luaotfload unusable. Please report to the maintainer of luatex.sty")
- else
- tex.count[luatex_sty_counter] = 0
- end
-end
-local last_alloc = 0
-function new_attribute(name, silent)
- if last_alloc >= 65535 then
- if silent then
- return -1
- else
- error("No room for a new \\attribute", 1)
- end
- end
- local lsc = tex.count[luatex_sty_counter]
- if lsc and lsc > last_alloc then
- last_alloc = lsc
- end
- last_alloc = last_alloc + 1
- if lsc then
- tex.setcount('global', luatex_sty_counter, last_alloc)
- end
- attributes[name] = last_alloc
- unset_attribute(name)
- if not silent then
- log('luatexbase.attributes[%q] = %d', name, last_alloc)
- end
- return last_alloc
-end
-luatexbase.new_attribute = new_attribute
-local unset_value = (luatexbase.luatexversion < 37) and -1 or -2147483647
-function unset_attribute(name)
- tex.setattribute(attributes[name], unset_value)
-end
-luatexbase.unset_attribute = unset_attribute
-luatexbase.get_unset_value = function () return unset_value end
---- cf. luatexref-t.pdf, sect. 8.1.4.25
-local user_whatsits = { --- (package, (name, id hash)) hash
- __unassociated = { }, --- those without package name
-}
-local whatsit_ids = { } --- (id, (name * package)) hash
-local whatsit_cap = 2^53 --- Lua numbers are doubles
-local current_whatsit = 0
-local anonymous_whatsits = 0
-local anonymous_prefix = "anon"
---- string -> string -> int
-local new_user_whatsit_id = function (name, package)
- if name then
- if not package then
- package = unassociated
- end
- else -- anonymous
- anonymous_whatsits = anonymous_whatsits + 1
- warning("defining anonymous user whatsit no. %d", anonymous_whatsits)
- warning("dear package authors, please name your whatsits!")
- package = unassociated
- name = anonymous_prefix .. tostring(anonymous_whatsits)
- end
-
- local whatsitdata = user_whatsits[package]
- if not whatsitdata then
- whatsitdata = { }
- user_whatsits[package] = whatsitdata
- end
-
- local id = whatsitdata[name]
- if id then --- warning
- warning("replacing whatsit %s:%s (%d)", package, name, id)
- else --- new id
- current_whatsit = current_whatsit + 1
- if current_whatsit >= whatsit_cap then
- warning("maximum of %d integral user whatsit ids reached",
- whatsit_cap)
- warning("further whatsit allocation may be inconsistent")
- end
- id = current_whatsit
- whatsitdata[name] = id
- whatsit_ids[id] = { name, package }
- end
- log("new user-defined whatsit %d (%s:%s)", id, package, name)
- return id
-end
-luatexbase.new_user_whatsit_id = new_user_whatsit_id
---- (string | node_t) -> string -> ((unit -> node_t) * int)
-local new_user_whatsit = function (req, package)
- local id, whatsit
- if type(req) == "string" then
- id = new_user_whatsit_id(req, package)
- whatsit = newnode(whatsit_t, user_defined_t)
- whatsit.user_id = id
- elseif req.id == whatsit_t and req.subtype == user_defined_t then
- id = req.user_id
- whatsit = copynode(req)
- if not whatsit_ids[id] then
- warning("whatsit id %d unregistered; "
- .. "inconsistencies may arise", id)
- end
- end
- return function () return copynode(whatsit) end, id
-end
-luatexbase.new_user_whatsit = new_user_whatsit
---- string -> string -> int
-local get_user_whatsit_id = function (name, package)
- if not package then
- package = unassociated
- end
- return user_whatsits[package][name]
-end
-luatexbase.get_user_whatsit_id = get_user_whatsit_id
---- int | fun | node -> (string, string)
-local get_user_whatsit_name = function (asked)
- local id
- if type(asked) == "number" then
- id = asked
- elseif type(asked) == "function" then
- --- node generator
- local n = asked()
- id = n.user_id
- else --- node
- id = asked.user_id
- end
- local metadata = whatsit_ids[id]
- if not metadata then -- unknown
- warning("whatsit id %d unregistered; inconsistencies may arise", id)
- return "", ""
- end
- return tableunpack(metadata)
-end
-luatexbase.get_user_whatsit_name = get_user_whatsit_name
---- string -> unit
-local dump_registered_whatsits = function (asked_package)
- local whatsit_list = { }
- if asked_package then
- local whatsitdata = user_whatsits[asked_package]
- if not whatsitdata then
- error("(no user whatsits registered for package %s)",
- asked_package)
- return
- end
- texiowrite_nl("(user whatsit allocation stats for " .. asked_package)
- for name, id in next, whatsitdata do
- whatsit_list[#whatsit_list+1] =
- stringformat("(%s:%s %d)", asked_package, name, id)
- end
- else
- texiowrite_nl("(user whatsit allocation stats")
- texiowrite_nl(stringformat(" ((total %d)\n (anonymous %d))",
- current_whatsit, anonymous_whatsits))
- for package, whatsitdata in next, user_whatsits do
- for name, id in next, whatsitdata do
- whatsit_list[#whatsit_list+1] =
- stringformat("(%s:%s %d)", package, name, id)
- end
- end
- end
-
- texiowrite_nl" ("
- --- in an attempt to be clever the texio.write* functions
- --- mess up line breaking, so concatenation is unusable ...
- local first = true
- for i=1, #whatsit_list do
- if first then
- first = false
- else -- indent
- texiowrite_nl" "
- end
- texiowrite(whatsit_list[i])
- end
- texiowrite"))\n"
-end
-luatexbase.dump_registered_whatsits = dump_registered_whatsits
-luatexbase.newattribute = new_attribute
-luatexbase.newuserwhatsit = new_user_whatsit
-luatexbase.newuserwhatsitid = new_user_whatsit_id
-luatexbase.getuserwhatsitid = get_user_whatsit_id
-luatexbase.getuserwhatsitname = get_user_whatsit_name
-luatexbase.dumpregisteredwhatsits = dump_registered_whatsits
---
--- End of File `attr.lua'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/cctb.lua b/Master/texmf-dist/tex/luatex/luatexbase/cctb.lua
deleted file mode 100644
index 86b7297a440..00000000000
--- a/Master/texmf-dist/tex/luatex/luatexbase/cctb.lua
+++ /dev/null
@@ -1,41 +0,0 @@
---
--- This is file `cctb.lua',
--- generated with the docstrip utility.
---
--- The original source files were:
---
--- luatexbase-cctb.dtx (with options: `luamodule')
---
--- See the aforementioned source file(s) for copyright and licensing information.
---
-luatexbase = luatexbase or { }
-local luatexbase = luatexbase
-luatexbase.provides_module({
- name = "luatexbase-cctb",
- version = 0.6,
- date = "2013/05/11",
- description = "Catcodetable allocation for LuaTeX",
- author = "Heiko Oberdiek, Elie Roux and Manuel Pegourie-Gonnard",
- copyright = "Heiko Oberdiek, Elie Roux and Manuel Pegourie-Gonnard",
- license = "CC0",
-})
-luatexbase.catcodetables = luatexbase.catcodetables or { }
-local catcodetables = luatexbase.catcodetables
-local function catcodetabledef_from_tex(name, number)
- catcodetables[name] = tonumber(number)
-end
-luatexbase.catcodetabledef_from_tex = catcodetabledef_from_tex
-local function catcodetable_do_shortcuts()
- local cat = catcodetables
- cat['latex'] = cat.CatcodeTableLaTeX
- cat['latex-package'] = cat.CatcodeTableLaTeXAtLetter
- cat['latex-atletter'] = cat.CatcodeTableLaTeXAtLetter
- cat['ini'] = cat.CatcodeTableIniTeX
- cat['expl3'] = cat.CatcodeTableExpl
- cat['expl'] = cat.CatcodeTableExpl
- cat['string'] = cat.CatcodeTableString
- cat['other'] = cat.CatcodeTableOther
-end
-luatexbase.catcodetable_do_shortcuts = catcodetable_do_shortcuts
---
--- End of File `cctb.lua'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
index be0e86947cd..ac46ebea69f 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-attr.sty
@@ -1,111 +1,14 @@
-%%
-%% This is file `luatexbase-attr.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luatexbase-attr.dtx (with options: `texpackage')
-%%
-%% See the aforementioned source file(s) for copyright and licensing information.
-%%
-\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
- \catcode123 1 % {
- \catcode125 2 % }
- \catcode 35 6 % #
- \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
- \edef\x{\endlinechar13}%
- \def\y#1 #2 {%
- \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
- \edef\x{\x \catcode#1 #2}}%
- \y 13 5 % carriage return
- \y 61 12 % =
- \y 32 10 % space
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 64 11 % @ (letter)
- \y 10 12 % new line ^^J
- \y 34 12 % "
- \y 39 12 % '
- \y 40 12 % (
- \y 41 12 % )
- \y 44 12 % ,
- \y 45 12 % -
- \y 46 12 % .
- \y 47 12 % /
- \y 58 12 % :
- \y 60 12 % <
- \y 62 12 % >
- \y 91 12 % [
- \y 93 12 % ]
- \y 94 7 % ^
- \y 95 8 % _
- \y 96 12 % `
- \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\noexpand\expandafter\endgroup%
- \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
- \noexpand\else \noexpand\expandafter\noexpand\endinput%
- \noexpand\fi}%
-\expandafter\y\csname luatexbase@attr@sty@endinput\endcsname%
-\begingroup
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
- \else
- \let\x\ProvidesPackage
- \fi
-\expandafter\endgroup
-\x{luatexbase-attr}[2013/05/11 v0.6 Attributes allocation for LuaTeX]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifluatex.sty
-\else
- \RequirePackage{ifluatex}
-\fi
-\ifluatex\else
- \begingroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \def\x#1#2#3{\begingroup \newlinechar10
- \errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
- \else
- \let\x\PackageError
- \fi
- \expandafter\endgroup
- \x{luatexbase-attr}{LuaTeX is required for this package. Aborting.}{%
- This package can only be used with the LuaTeX engine^^J%
- (command `lualatex' or `luatex').^^J%
- Package loading has been stopped to prevent additional errors.}
- \expandafter\luatexbase@attr@sty@endinput%
+
+\ifx
+ \ProvidesPackage\undefined\begingroup\def\ProvidesPackage
+ #1#2[#3]{\endgroup\immediate\write-1{Package: #1 #3}}
\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input luatexbase-modutils.sty
- \input luatex.sty
+\ProvidesPackage{luatexbase-attr}
+[2015/10/01 v1.0
+ luatexbase interface to LuaTeX (legacy subpackage)
+]
+\ifx\RequirePackage\undefined
+ \input{luatexbase.sty}%
\else
- \RequirePackage{luatexbase-modutils}
- \RequirePackage{luatex}
+ \RequirePackage{luatexbase}
\fi
-\luatexbase@ensure@primitive{luaescapestring}
-\luatexbase@ensure@primitive{attributedef}
-\luatexbase@ensure@primitive{attribute}
-\luatexbase@directlua{require('luatexbase.attr')}
-\def\newluatexattribute#1{%
- \begingroup\escapechar\m@ne \expandafter\expandafter\expandafter
- \endgroup \expandafter\expandafter\expandafter
- \allocationnumber \luatexbase@directlua{tex.write(
- luatexbase.new_attribute("\luatexluaescapestring{\string#1}", true))}%
- \ifnum\allocationnumber>\m@ne
- \global\luatexattributedef#1=\allocationnumber
- \wlog{\string#1=\string\luatexattribute\the\allocationnumber}%
- \else
- \errmessage{No room for a new \string\attribute}%
- \fi}
-\newcount\lltxb@attr@unsetvalue
-\lltxb@attr@unsetvalue=\ifnum\luatexversion<37 -1\else -2147483647\fi\relax
-\def\unsetluatexattribute#1{%
- #1\lltxb@attr@unsetvalue}
-\def\setluatexattribute#1#2{%
- #1=\numexpr#2\relax}
-\luatexbase@attr@sty@endinput%
-\endinput
-%%
-%% End of file `luatexbase-attr.sty'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty
index 69c45b25466..098c6442667 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty
@@ -1,242 +1,14 @@
-%%
-%% This is file `luatexbase-cctb.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luatexbase-cctb.dtx (with options: `texpackage')
-%%
-%% See the aforementioned source file(s) for copyright and licensing information.
-%%
-\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
- \catcode123 1 % {
- \catcode125 2 % }
- \catcode 35 6 % #
- \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
- \edef\x{\endlinechar13}%
- \def\y#1 #2 {%
- \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
- \edef\x{\x \catcode#1 #2}}%
- \y 13 5 % carriage return
- \y 61 12 % =
- \y 32 10 % space
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 64 11 % @ (letter)
- \y 10 12 % new line ^^J
- \y 39 12 % '
- \y 40 12 % (
- \y 41 12 % )
- \y 44 12 % ,
- \y 45 12 % -
- \y 46 12 % .
- \y 47 12 % /
- \y 58 12 % :
- \y 60 12 % <
- \y 62 12 % >
- \y 91 12 % [
- \y 93 12 % ]
- \y 94 7 % ^
- \y 95 8 % _
- \y 96 12 % `
- \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\noexpand\expandafter\endgroup%
- \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
- \noexpand\else \noexpand\expandafter\noexpand\endinput%
- \noexpand\fi}%
-\expandafter\y\csname luatexbase@cctb@sty@endinput\endcsname%
-\begingroup
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
- \else
- \let\x\ProvidesPackage
- \fi
-\expandafter\endgroup
-\x{luatexbase-cctb}[2013/05/11 v0.6 Catcodetable allocation for LuaTeX]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifluatex.sty
+
+\ifx
+ \ProvidesPackage\undefined\begingroup\def\ProvidesPackage
+ #1#2[#3]{\endgroup\immediate\write-1{Package: #1 #3}}
+\fi
+\ProvidesPackage{luatexbase-cctb}
+[2015/10/01 v1.0
+ luatexbase interface to LuaTeX (legacy subpackage)
+]
+\ifx\RequirePackage\undefined
+ \input{luatexbase.sty}%
\else
- \RequirePackage{ifluatex}
+ \RequirePackage{luatexbase}
\fi
-\ifluatex\else
- \begingroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \def\x#1#2#3{\begingroup \newlinechar10
- \errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
- \else
- \let\x\PackageError
- \fi
- \expandafter\endgroup
- \x{luatexbase-cctb}{LuaTeX is required for this package. Aborting.}{%
- This package can only be used with the LuaTeX engine^^J%
- (command `lualatex' or `luatex').^^J%
- Package loading has been stopped to prevent additional errors.}
- \expandafter\luatexbase@cctb@sty@endinput%
-\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input luatexbase-modutils.sty
-\else
- \RequirePackage{luatexbase-modutils}
-\fi
-\luatexbase@directlua{require('luatexbase.cctb')}
-\luatexbase@ensure@primitive{luaescapestring}
-\luatexbase@ensure@primitive{catcodetable}
-\luatexbase@ensure@primitive{initcatcodetable}
-\luatexbase@ensure@primitive{savecatcodetable}
-\newcount\lltxb@catcodetable@alloc
-\lltxb@catcodetable@alloc\m@ne
-\newcount\CatcodeTableStack
-\CatcodeTableStack\z@
-\def\newluatexcatcodetable#1{%
- \ifnum\lltxb@catcodetable@alloc<65535\relax
- \global\advance\lltxb@catcodetable@alloc\tw@
- \allocationnumber\lltxb@catcodetable@alloc
- \global\chardef#1\allocationnumber
- \luatexinitcatcodetable\allocationnumber
- \begingroup\escapechar\m@ne
- \luatexbase@directlua{luatexbase.catcodetabledef_from_tex(
- '\luatexluaescapestring{\string#1}', '\number\allocationnumber')}%
- \endgroup
- \wlog{\string#1=\string\luatexcatcodetable\the\allocationnumber}%
- \else
- \errmessage{No room for a new \string\luatexcatcodetable}%
- \fi}
-\def\IncCatcodeTableStack{%
- \ifnum\CatcodeTableStack<65534\relax
- \global\advance\CatcodeTableStack\tw@
- \else
- \errmessage{CatcodeTableStack overflow}%
- \fi}
-\def\DecCatcodeTableStack{%
- \ifnum\CatcodeTableStack>\z@
- \global\advance\CatcodeTableStack-2\relax
- \else
- \errmessage{CatcodeTableStack underflow}%
- \fi}
-\expandafter\ifx\csname @tempcnta\endcsname\relax
- \csname newcount\endcsname\@tempcnta
-\fi
-\expandafter\ifx\csname @tempcntb\endcsname\relax
- \csname newcount\endcsname\@tempcntb
-\fi
-\def\SetCatcodeRange#1#2#3{%
- \edef\luaSCR@temp{%
- \noexpand\@tempcnta=\the\@tempcnta
- \noexpand\@tempcntb=\the\@tempcntb
- \noexpand\count@=\the\count@
- \relax}%
- \@tempcnta=#1\relax
- \@tempcntb=#2\relax
- \count@=#3\relax
- \loop\unless\ifnum\@tempcnta>\@tempcntb
- \catcode\@tempcnta=\count@
- \advance\@tempcnta\@ne
- \repeat
- \luaSCR@temp}
-\def\lltxb@synonym#1#2{%
- \def#1{%
- \begingroup
- \ifdefined\PackageWarning
- \let\x\PackageWarning
- \else
- \def\x####1####2{%
- \begingroup \endlinechar10
- \message{Package ####1 warning: ####2}%
- \endgroup}
- \fi
- \expandafter\endgroup
- \x{luatex}{\string#1 is deprecated^^J%
- and will be removed in the next version of the package.^^J%
- Please use \string#2 instead.}
- \let#1#2%
- #1}}
-\lltxb@synonym \setcatcoderange \SetCatcodeRange
-\def\setluatexcatcodetable#1#2{%
- \begingroup
- #2%
- \luatexsavecatcodetable#1%
- \endgroup}
-\newluatexcatcodetable\CatcodeTableIniTeX
-\newluatexcatcodetable\CatcodeTableString
-\setluatexcatcodetable\CatcodeTableString{%
- \luatexcatcodetable\CatcodeTableIniTeX
- \catcode0 12 % nul
- \catcode13 12 % carriage return
- \catcode37 12 % percent
- \SetCatcodeRange{65}{90}{12}% A-Z
- \SetCatcodeRange{97}{122}{12}% a-z
- \catcode92 12 % backslash
- \catcode127 12 }
-\newluatexcatcodetable\CatcodeTableOther
-\setluatexcatcodetable\CatcodeTableOther{%
- \luatexcatcodetable\CatcodeTableString
- \catcode32 12 }
-\newluatexcatcodetable\CatcodeTableLaTeX
-\setluatexcatcodetable\CatcodeTableLaTeX{%
- \luatexcatcodetable\CatcodeTableIniTeX
- \SetCatcodeRange{0}{31}{15}%
- \catcode9 10 % tab
- \catcode10 12 % newline
- \catcode12 13 % form feed
- \catcode13 5 % carriage return
- \catcode35 6 % hash
- \catcode36 3 % dollar
- \catcode38 4 % ampersand
- \catcode94 7 % circumflex
- \catcode95 8 % underscore
- \catcode123 1 % brace left
- \catcode125 2 % brace right
- \catcode126 13 % tilde
- \catcode127 15 }
-\newluatexcatcodetable\CatcodeTableLaTeXAtLetter
-\setluatexcatcodetable\CatcodeTableLaTeXAtLetter{%
- \luatexcatcodetable\CatcodeTableLaTeX
- \catcode64=11 }
-\newluatexcatcodetable\CatcodeTableExpl
-\setluatexcatcodetable\CatcodeTableExpl{%
- \luatexcatcodetable\CatcodeTableLaTeX
- \catcode126 10 % tilde is a space char
- \catcode32 9 % space is ignored
- \catcode9 9 % tab also ignored
- \catcode95 11 % underscore letter
- \catcode58 11 % colon letter
- }
-\luatexbase@directlua{luatexbase.catcodetable_do_shortcuts()}
-\def\lltxb@cctb@numstack{0}
-\def\PushCatcodeTableNumStack{%
- \xdef\lltxb@cctb@numstack{{\the\luatexcatcodetable}\lltxb@cctb@numstack}}
-\def\PopCatcodeTableNumStack{%
- \expandafter\lltxb@cctb@numstack@pop\lltxb@cctb@numstack\@nil}
-\def\lltxb@cctb@numstack@pop#1#2\@nil{%
- \ifx\empty#2\empty
- \begingroup
- \ifdefined\PackageWarning
- \let\x\PackageWarning
- \else
- \def\x####1####2{%
- \begingroup \endlinechar10
- \message{Package ####1 warning: ####2}%
- \endgroup}%
- \fi
- \expandafter\endgroup
- \x{luatexbase-cctb}{Popping from an empty CatcodeTableNumStack}%
- \luatexcatcodetable\z@
- \else
- \gdef\lltxb@cctb@numstack{#2}%
- \luatexcatcodetable#1\relax
- \fi}
-\def\BeginCatcodeRegime#1{%
- \PushCatcodeTableNumStack
- \IncCatcodeTableStack
- \setluatexcatcodetable\CatcodeTableStack{\luatexcatcodetable#1}%
- \luatexcatcodetable\CatcodeTableStack}
-\def\EndCatcodeRegime{%
- \DecCatcodeTableStack
- \PopCatcodeTableNumStack}
-\luatexbase@cctb@sty@endinput%
-\endinput
-%%
-%% End of file `luatexbase-cctb.sty'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-compat.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-compat.sty
index 43852a72b1d..42fe852fc12 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-compat.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-compat.sty
@@ -1,135 +1,14 @@
-%%
-%% This is file `luatexbase-compat.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luatexbase-compat.dtx (with options: `texpackage')
-%%
-%% See the aforementioned source file(s) for copyright and licensing information.
-%%
-\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
- \catcode123 1 % {
- \catcode125 2 % }
- \catcode 35 6 % #
- \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
- \edef\x{\endlinechar13}%
- \def\y#1 #2 {%
- \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
- \edef\x{\x \catcode#1 #2}}%
- \y 13 5 % carriage return
- \y 61 12 % =
- \y 32 10 % space
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 64 11 % @ (letter)
- \y 10 12 % new line ^^J
- \y 39 12 % '
- \y 40 12 % (
- \y 41 12 % )
- \y 42 12 % *
- \y 44 12 % ,
- \y 45 12 % -
- \y 46 12 % .
- \y 47 12 % /
- \y 58 12 % :
- \y 60 12 % <
- \y 91 12 % [
- \y 93 12 % ]
- \y 94 7 % ^
- \y 96 12 % `
- \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\noexpand\expandafter\endgroup%
- \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
- \noexpand\else \noexpand\expandafter\noexpand\endinput%
- \noexpand\fi}%
-\expandafter\y\csname luatexbase@compat@sty@endinput\endcsname%
-\begingroup
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
- \else
- \let\x\ProvidesPackage
- \fi
-\expandafter\endgroup
-\x{luatexbase-compat}[2011/05/24 v0.4 Compatibility tools for LuaTeX]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifluatex.sty
-\else
- \RequirePackage{ifluatex}
-\fi
-\ifluatex\else
- \begingroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \def\x#1#2#3{\begingroup \newlinechar10
- \errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
- \else
- \let\x\PackageError
- \fi
- \expandafter\endgroup
- \x{luatexbase-compat}{LuaTeX is required for this package. Aborting.}{%
- This package can only be used with the LuaTeX engine^^J%
- (command `lualatex' or `luatex').^^J%
- Package loading has been stopped to prevent additional errors.}
- \expandafter\luatexbase@compat@sty@endinput%
-\fi
-\begingroup
-\expandafter\ifx\csname newcommand\endcsname\relax
- \toks0{\long\def\luatexbase@directlua}%
-\else
- \toks0{\newcommand\luatexbase@directlua}%
-\fi
-\ifnum\luatexversion<36
- \toks0\expandafter{\the\toks0{\directlua0}}%
-\else
- \toks0\expandafter{\the\toks0{\directlua}}%
-\fi
-\expandafter\endgroup
-\the\toks0
-\luatexbase@directlua{%
- luatexbase = luatexbase or {}
- luatexbase.luatexversion = \number\luatexversion\space
- luatexbase.luatexrevision = \number\luatexrevision\space}
-\begingroup
-\expandafter\ifx\csname newcommand\endcsname\relax
- \toks0{\def\luatexbase@ensure@primitive#1}
-\else
- \toks0{\newcommand*\luatexbase@ensure@primitive[1]}
+
+\ifx
+ \ProvidesPackage\undefined\begingroup\def\ProvidesPackage
+ #1#2[#3]{\endgroup\immediate\write-1{Package: #1 #3}}
\fi
-\toks2{}\def\x#1{\toks2\expandafter{\the\toks2 #1}}
-\x{%
- \ifcsname luatex#1\endcsname \else}
-\ifnum\luatexversion<37\relax
- \x{%
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname #1\endcsname\relax}
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \x{%
- \errmessage{%
- Package luatexbase-compat error: failed to enable `#1'.}}
- \else
- \x{%
- \PackageError{luatexbase-compat}{%
- Package luatexbase-compat error: failed to enable `#1'.}{}}
- \fi
- \x{%
- \else}
- \x{%
- \expandafter\let\csname luatex#1\expandafter\endcsname
- \csname#1\endcsname
- \fi}
+\ProvidesPackage{luatexbase-compat}
+[2015/10/01 v1.0
+ luatexbase interface to LuaTeX (legacy subpackage)
+]
+\ifx\RequirePackage\undefined
+ \input{luatexbase.sty}%
\else
- \x{%
- \luatexbase@directlua{tex.enableprimitives('luatex', {'#1'})}}
+ \RequirePackage{luatexbase}
\fi
-\x{%
- \fi}
-\toks0\expandafter{\the\toks0\expandafter{\the\toks2}}
-\expandafter\endgroup
-\the\toks0
-\luatexbase@compat@sty@endinput%
-\endinput
-%%
-%% End of file `luatexbase-compat.sty'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-loader.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-loader.sty
index 7279cf073a3..0f58870b475 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-loader.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-loader.sty
@@ -1,92 +1,14 @@
-%%
-%% This is file `luatexbase-loader.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luatexbase-loader.dtx (with options: `texpackage')
-%%
-%% See the aforementioned source file(s) for copyright and licensing information.
-%%
-\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
- \catcode123 1 % {
- \catcode125 2 % }
- \catcode 35 6 % #
- \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
- \edef\x{\endlinechar13}%
- \def\y#1 #2 {%
- \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
- \edef\x{\x \catcode#1 #2}}%
- \y 13 5 % carriage return
- \y 61 12 % =
- \y 32 10 % space
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 64 11 % @ (letter)
- \y 10 12 % new line ^^J
- \y 34 12 % "
- \y 39 12 % '
- \y 40 12 % (
- \y 41 12 % )
- \y 44 12 % ,
- \y 45 12 % -
- \y 46 12 % .
- \y 47 12 % /
- \y 58 12 % :
- \y 91 12 % [
- \y 93 12 % ]
- \y 94 7 % ^
- \y 95 8 % _
- \y 96 12 % `
- \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\noexpand\expandafter\endgroup%
- \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
- \noexpand\else \noexpand\expandafter\noexpand\endinput%
- \noexpand\fi}%
-\expandafter\y\csname luatexbase@loader@sty@endinput\endcsname%
-\begingroup
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
- \else
- \let\x\ProvidesPackage
- \fi
-\expandafter\endgroup
-\x{luatexbase-loader}[2013/05/11 v0.6 Lua module loader for LuaTeX]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifluatex.sty
-\else
- \RequirePackage{ifluatex}
-\fi
-\ifluatex\else
- \begingroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \def\x#1#2#3{\begingroup \newlinechar10
- \errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
- \else
- \let\x\PackageError
- \fi
- \expandafter\endgroup
- \x{luatexbase-loader}{LuaTeX is required for this package. Aborting.}{%
- This package can only be used with the LuaTeX engine^^J%
- (command `lualatex' or `luatex').^^J%
- Package loading has been stopped to prevent additional errors.}
- \expandafter\luatexbase@loader@sty@endinput%
+
+\ifx
+ \ProvidesPackage\undefined\begingroup\def\ProvidesPackage
+ #1#2[#3]{\endgroup\immediate\write-1{Package: #1 #3}}
\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input luatexbase-compat.sty
+\ProvidesPackage{luatexbase-loader}
+[2015/10/01 v1.0
+ luatexbase interface to LuaTeX (legacy subpackage)
+]
+\ifx\RequirePackage\undefined
+ \input{luatexbase.sty}%
\else
- \RequirePackage{luatexbase-compat}
+ \RequirePackage{luatexbase}
\fi
-\luatexbase@directlua{%
- local file = "luatexbase.loader.lua"
- local path = assert(kpse.find_file(file, 'lua'),
- "File '"..file.."' not found")
- texio.write_nl("("..path..")")
- dofile(path)}
-\luatexbase@loader@sty@endinput%
-\endinput
-%%
-%% End of file `luatexbase-loader.sty'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-mcb.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-mcb.sty
index d2291653992..5defd977263 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-mcb.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-mcb.sty
@@ -1,84 +1,14 @@
-%%
-%% This is file `luatexbase-mcb.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luatexbase-mcb.dtx (with options: `texpackage')
-%%
-%% See the aforementioned source file(s) for copyright and licensing information.
-%%
-\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
- \catcode123 1 % {
- \catcode125 2 % }
- \catcode 35 6 % #
- \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
- \edef\x{\endlinechar13}%
- \def\y#1 #2 {%
- \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
- \edef\x{\x \catcode#1 #2}}%
- \y 13 5 % carriage return
- \y 61 12 % =
- \y 32 10 % space
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 64 11 % @ (letter)
- \y 10 12 % new line ^^J
- \y 39 12 % '
- \y 40 12 % (
- \y 41 12 % )
- \y 45 12 % -
- \y 46 12 % .
- \y 47 12 % /
- \y 58 12 % :
- \y 91 12 % [
- \y 93 12 % ]
- \y 94 7 % ^
- \y 96 12 % `
- \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\noexpand\expandafter\endgroup%
- \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
- \noexpand\else \noexpand\expandafter\noexpand\endinput%
- \noexpand\fi}%
-\expandafter\y\csname luatexbase@mcb@sty@endinput\endcsname%
-\begingroup
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
- \else
- \let\x\ProvidesPackage
- \fi
-\expandafter\endgroup
-\x{luatexbase-mcb}[2013/05/11 v0.6 Callback management for LuaTeX]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifluatex.sty
-\else
- \RequirePackage{ifluatex}
-\fi
-\ifluatex\else
- \begingroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \def\x#1#2#3{\begingroup \newlinechar10
- \errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
- \else
- \let\x\PackageError
- \fi
- \expandafter\endgroup
- \x{luatexbase-mcb}{LuaTeX is required for this package. Aborting.}{%
- This package can only be used with the LuaTeX engine^^J%
- (command `lualatex' or `luatex').^^J%
- Package loading has been stopped to prevent additional errors.}
- \expandafter\luatexbase@mcb@sty@endinput%
+
+\ifx
+ \ProvidesPackage\undefined\begingroup\def\ProvidesPackage
+ #1#2[#3]{\endgroup\immediate\write-1{Package: #1 #3}}
\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input luatexbase-modutils.sty
+\ProvidesPackage{luatexbase-mcb}
+[2015/10/01 v1.0
+ luatexbase interface to LuaTeX (legacy subpackage)
+]
+\ifx\RequirePackage\undefined
+ \input{luatexbase.sty}%
\else
- \RequirePackage{luatexbase-modutils}
+ \RequirePackage{luatexbase}
\fi
-\luatexbase@directlua{require('luatexbase.mcb')}
-\luatexbase@mcb@sty@endinput%
-\endinput
-%%
-%% End of file `luatexbase-mcb.sty'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-modutils.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-modutils.sty
index 7579f464a45..cd6cb4d0e6c 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-modutils.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-modutils.sty
@@ -1,132 +1,14 @@
-%%
-%% This is file `luatexbase-modutils.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luatexbase-modutils.dtx (with options: `texpackage')
-%%
-%% See the aforementioned source file(s) for copyright and licensing information.
-%%
-\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
- \catcode123 1 % {
- \catcode125 2 % }
- \catcode 35 6 % #
- \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
- \edef\x{\endlinechar13}%
- \def\y#1 #2 {%
- \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
- \edef\x{\x \catcode#1 #2}}%
- \y 13 5 % carriage return
- \y 61 12 % =
- \y 32 10 % space
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 64 11 % @ (letter)
- \y 10 12 % new line ^^J
- \y 34 12 % "
- \y 39 12 % '
- \y 40 12 % (
- \y 41 12 % )
- \y 44 12 % ,
- \y 45 12 % -
- \y 46 12 % .
- \y 47 12 % /
- \y 58 12 % :
- \y 91 12 % [
- \y 93 12 % ]
- \y 94 7 % ^
- \y 95 8 % _
- \y 96 12 % `
- \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\noexpand\expandafter\endgroup%
- \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
- \noexpand\else \noexpand\expandafter\noexpand\endinput%
- \noexpand\fi}%
-\expandafter\y\csname luatexbase@modutils@sty@endinput\endcsname%
-\begingroup
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
- \else
- \let\x\ProvidesPackage
- \fi
-\expandafter\endgroup
-\x{luatexbase-modutils}[2013/05/11 v0.6 Module utilities for LuaTeX]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifluatex.sty
+
+\ifx
+ \ProvidesPackage\undefined\begingroup\def\ProvidesPackage
+ #1#2[#3]{\endgroup\immediate\write-1{Package: #1 #3}}
+\fi
+\ProvidesPackage{luatexbase-modutils}
+[2015/10/01 v1.0
+ luatexbase interface to LuaTeX (legacy subpackage)
+]
+\ifx\RequirePackage\undefined
+ \input{luatexbase.sty}%
\else
- \RequirePackage{ifluatex}
+ \RequirePackage{luatexbase}
\fi
-\ifluatex\else
- \begingroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \def\x#1#2#3{\begingroup \newlinechar10
- \errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
- \else
- \let\x\PackageError
- \fi
- \expandafter\endgroup
- \x{luatexbase-modutils}{LuaTeX is required for this package. Aborting.}{%
- This package can only be used with the LuaTeX engine^^J%
- (command `lualatex' or `luatex').^^J%
- Package loading has been stopped to prevent additional errors.}
- \expandafter\luatexbase@modutils@sty@endinput%
-\fi
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input luatexbase-loader.sty
-\else
- \RequirePackage{luatexbase-loader}
-\fi
-\luatexbase@directlua{require('luatexbase.modutils')}
-\luatexbase@ensure@primitive{luaescapestring}
-\ifdefined\kernel@ifnextchar
- \let\lltxb@ifnextchar\kernel@ifnextchar
-\else
- \chardef\lltxb@zero0
- \chardef\lltxb@two2
- \long\def\lltxb@ifnextchar#1#2#3{%
- \begingroup
- \let\lltxb@CharToken= #1\relax
- \toks\lltxb@zero{#2}%
- \toks\lltxb@two{#3}%
- \futurelet\lltxb@LetToken\lltxb@ifnextchar@
- }
- \def\lltxb@ifnextchar@{%
- \ifx\lltxb@LetToken\lltxb@CharToken
- \expandafter\endgroup\the\toks\expandafter\lltxb@zero
- \else
- \ifx\lltxb@LetToken\lltxb@SpaceToken
- \expandafter\expandafter\expandafter\lltxb@@ifnextchar
- \else
- \expandafter\endgroup\the\toks
- \expandafter\expandafter\expandafter\lltxb@two
- \fi
- \fi
- }
- \begingroup
- \def\x#1{\endgroup
- \def\lltxb@@ifnextchar#1{%
- \futurelet\lltxb@LetToken\lltxb@ifnextchar@
- }%
- }%
- \x{ }
- \begingroup
- \def\x#1{\endgroup
- \let\lltxb@SpaceToken= #1%
- }%
- \x{ }
-\fi
-\def\RequireLuaModule#1{%
- \lltxb@ifnextchar[{\lltxb@requirelua{#1}}{\lltxb@requirelua{#1}[]}}
-\def\lltxb@requirelua#1[#2]{%
- \luatexbase@directlua{luatexbase.require_module(
- "\luatexluaescapestring{#1}"
- \expandafter\ifx\expandafter\/\detokenize{#2}\/\else
- , "\luatexluaescapestring{#2}"
- \fi)}}
-\luatexbase@modutils@sty@endinput%
-\endinput
-%%
-%% End of file `luatexbase-modutils.sty'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-regs.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-regs.sty
index 968e0f6e6d6..53e03cc877d 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-regs.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase-regs.sty
@@ -1,185 +1,14 @@
-%%
-%% This is file `luatexbase-regs.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luatexbase-regs.dtx (with options: `texpackage')
-%%
-%% See the aforementioned source file(s) for copyright and licensing information.
-%%
-\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
- \catcode123 1 % {
- \catcode125 2 % }
- \catcode 35 6 % #
- \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
- \edef\x{\endlinechar13}%
- \def\y#1 #2 {%
- \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
- \edef\x{\x \catcode#1 #2}}%
- \y 13 5 % carriage return
- \y 61 12 % =
- \y 32 10 % space
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 64 11 % @ (letter)
- \y 10 12 % new line ^^J
- \y 33 12 % !
- \y 36 3 % $ $ (in etex.sty)
- \y 39 12 % '
- \y 40 12 % (
- \y 41 12 % )
- \y 42 12 % * (in etex.sty)
- \y 43 12 % + (in etex.sty)
- \y 44 12 % , (in etex.sty)
- \y 45 12 % -
- \y 46 12 % .
- \y 47 12 % /
- \y 58 12 % :
- \y 60 12 % < (in etex.sty)
- \y 62 12 % > (in etex.sty)
- \y 91 12 % [
- \y 93 12 % ]
- \y 94 7 % ^
- \y 96 12 % `
- \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\noexpand\expandafter\endgroup%
- \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
- \noexpand\else \noexpand\expandafter\noexpand\endinput%
- \noexpand\fi}%
-\expandafter\y\csname luatexbase@regs@sty@endinput\endcsname%
-\begingroup
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
- \else
- \let\x\ProvidesPackage
- \fi
-\expandafter\endgroup
-\x{luatexbase-regs}[2011/05/24 v0.4 Registers allocation for LuaTeX]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifluatex.sty
+
+\ifx
+ \ProvidesPackage\undefined\begingroup\def\ProvidesPackage
+ #1#2[#3]{\endgroup\immediate\write-1{Package: #1 #3}}
+\fi
+\ProvidesPackage{luatexbase-regs}
+[2015/10/01 v1.0
+ luatexbase interface to LuaTeX (legacy subpackage)
+]
+\ifx\RequirePackage\undefined
+ \input{luatexbase.sty}%
\else
- \RequirePackage{ifluatex}
+ \RequirePackage{luatexbase}
\fi
-\ifluatex\else
- \begingroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \def\x#1#2#3{\begingroup \newlinechar10
- \errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
- \else
- \let\x\PackageError
- \fi
- \expandafter\endgroup
- \x{luatexbase-regs}{LuaTeX is required for this package. Aborting.}{%
- This package can only be used with the LuaTeX engine^^J%
- (command `lualatex' or `luatex').^^J%
- Package loading has been stopped to prevent additional errors.}
- \expandafter\luatexbase@regs@sty@endinput%
-\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax \else
- \RequirePackage{etex}[1998/03/26]
-\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname et@xins\endcsname\relax
- \begingroup
- \expandafter\ifx\csname PackageWarningNoLine\endcsname\relax
- \def\x#1#2{\begingroup\newlinechar10
- \immediate\write16{Package #1 warning: #2}\endgroup}
- \else
- \let\x\PackageWarningNoLine
- \fi
- \expandafter\endgroup
- \x{luatexbase-regs}{etex macros not loaded!^^J%
- Registers allocation scheme will not be extended.}
-\else
- \ifnum\count270=32768 \count270=65536 \fi
- \ifnum\count271=32768 \count271=65536 \fi
- \ifnum\count272=32768 \count272=65536 \fi
- \ifnum\count273=32768 \count272=65536 \fi
- \ifnum\count273=32768 \count273=65536 \fi
- \ifnum\count274=32768 \count274=65536 \fi
- \ifnum\count275=32768 \count275=65536 \fi
- \ifnum\count276=32768 \count276=65536 \fi
- \begingroup \toks0{}
- \def\@namedef #1{\expandafter \def\csname#1\endcsname}
- \def\@outerdef#1{\expandafter\outer\expandafter\def\csname#1\endcsname}
- \def\def@globbox #1#2{\@outerdef{#1}{\et@xglob 4 \box #2}}
- \def\def@locbox #1#2{\@namedef {#1}{\et@xloc 4 \box #2}}
- \def\def@globmarks #1#2{\@outerdef{#1}{\et@xglob 6 \marks #2}}
- \def\def@locmarks #1#2{\@namedef {#1}{\et@xloc 6 \marks #2}}
- \def\def@et@xgblk#1#2{\@namedef{#1}##1##2##3##4%
- {\et@xchkblk ##1##2{##4}%
- {\allocationnumber=\count 26##1
- \global \advance \count 26##1 by ##4%
- \global #2##3=\allocationnumber
- \wlog {\string ##3=\string ##2blk{\number ##4}
- at \the \allocationnumber}%
- }%
- }}
- \def\def@et@xlblk#1#2{\@namedef{#1}##1##2##3##4%
- {\et@xchkblk ##1##2{##4}%
- {\advance \count 27##1 by -##4%
- \allocationnumber=\count 27##1
- #2##3=\allocationnumber
- \wlog {\string ##3=\string ##2blk{\number ##4}
- at \the \allocationnumber \space (local)%
- }%
- }%
- }}
- \def\alt@globbox #1#2{\@namedef{#1}{\et@xglob 4\box #2}}
- \def\alt@locbox #1#2{\@namedef{#1}{\et@xloc 4\box #2}}
- \def\alt@globmarks #1#2{\@namedef{#1}{\et@xglob 6\marks #2}}
- \def\alt@locmarks #1#2{\@namedef{#1}{\et@xloc 6\marks #2}}
- \def\alt@et@xgblk#1#2{\@namedef{#1}##1##2##3##4%
- {\et@xchkblk##1##2{##4}%
- {\allocationnumber\count26##1%
- \global\advance\count26##1by##4%
- \global#2##3\allocationnumber
- \wlog{\string##3=\string##2blk{\number##4} at
- \the\allocationnumber}%
- }%
- }}
- \def\alt@et@xlblk#1#2{\@namedef{#1}##1##2##3##4%
- {\et@xchkblk##1##2{##4}%
- {\advance\count27##1-##4%
- \allocationnumber\count27##1%
- #2##3\allocationnumber
- \et@xwlog{\string##3=\string##2blk{\number##4} at
- \the\allocationnumber\space(local)}%
- }%
- }}
- \def\check@def#1{%
- \csname def@#1\endcsname{test@#1}\mathchardef
- \expandafter\ifx\csname test@#1\expandafter\endcsname
- \csname #1\endcsname
- \expandafter\let\csname #1\endcsname\relax
- \toks0\expandafter{\the\toks0\csname def@#1\endcsname{#1}\chardef}
- \else
- \csname alt@#1\endcsname{test@#1}\mathchardef
- \expandafter\ifx\csname test@#1\expandafter\endcsname
- \csname #1\endcsname
- \toks0\expandafter{\the\toks0\csname alt@#1\endcsname{#1}\chardef}
- \else
- \expandafter\show\csname BAD#1\endcsname
- \fi
- \fi}
- \check@def{globbox}
- \check@def{locbox}
- \check@def{globmarks}
- \check@def{locmarks}
- \check@def{et@xgblk}
- \check@def{et@xlblk}
- \expandafter \endgroup
- \the\toks0
- \expandafter\let\csname newcount\endcsname\globcount
- \expandafter\let\csname newdimen\endcsname\globdimen
- \expandafter\let\csname newskip\endcsname\globskip
- \expandafter\let\csname newbox\endcsname\globbox
-\fi
-\luatexbase@regs@sty@endinput%
-\endinput
-%%
-%% End of file `luatexbase-regs.sty'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase.loader.lua b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase.loader.lua
deleted file mode 100644
index fce0ab79ea4..00000000000
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase.loader.lua
+++ /dev/null
@@ -1,65 +0,0 @@
---
--- This is file `luatexbase.loader.lua',
--- generated with the docstrip utility.
---
--- The original source files were:
---
--- luatexbase-loader.dtx (with options: `luamodule')
---
--- See the aforementioned source file(s) for copyright and licensing information.
---
-luatexbase = luatexbase or { }
-local luatexbase = luatexbase
-kpse.set_program_name("luatex")
-local print_included_path = false
-if token then
- print_included_path = true
-end
-local lua_suffixes = {
- ".luc", ".luctex", ".texluc", ".lua", ".luatex", ".texlua",
-}
-local function ends_with(suffix, name)
- return name:sub(-suffix:len()) == suffix
-end
-local function basename(name)
- for _, suffix in ipairs(lua_suffixes) do
- if ends_with(suffix, name) then
- return name:sub(1, -(suffix:len()+1))
- end
- end
- return name
-end
-local function find_module_file(mod)
- local compat = basename(mod):gsub('%.', '/')
- return kpse.find_file(compat, 'lua') or kpse.find_file(mod, 'lua')
-end
-local package_loader_two
-if not package.searchers then
- package.searchers = package.loaders
-end
-package_loader_two = package.searchers[2]
-local function load_module(mod)
- local file = find_module_file(mod)
- if not file then
- local msg = "\n\t[luatexbase.loader] Search failed"
- local ret = package_loader_two(mod)
- if type(ret) == 'string' then
- return msg..ret
- elseif type(ret) == 'nil' then
- return msg
- else
- return ret
- end
- end
- local loader, error = loadfile(file)
- if not loader then
- return "\n\t[luatexbase.loader] Loading error:\n\t"..error
- end
- if print_included_path then
- texio.write_nl("("..file..")")
- end
- return loader
-end
-package.searchers[2] = load_module
---
--- End of File `luatexbase.loader.lua'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase.sty b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
index 6355abad35f..bc985aab9ab 100644
--- a/Master/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
+++ b/Master/texmf-dist/tex/luatex/luatexbase/luatexbase.sty
@@ -1,100 +1,277 @@
-%%
-%% This is file `luatexbase.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% luatexbase.dtx (with options: `texpackage')
-%%
-%% See the aforementioned source file(s) for copyright and licensing information.
-%%
-\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
- \catcode123 1 % {
- \catcode125 2 % }
- \catcode 35 6 % #
- \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
- \edef\x{\endlinechar13}%
- \def\y#1 #2 {%
- \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
- \edef\x{\x \catcode#1 #2}}%
- \y 13 5 % carriage return
- \y 61 12 % =
- \y 32 10 % space
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 64 11 % @ (letter)
- \y 10 12 % new line ^^J
- \y 39 12 % '
- \y 40 12 % (
- \y 41 12 % )
- \y 45 12 % -
- \y 46 12 % .
- \y 47 12 % /
- \y 58 12 % :
- \y 91 12 % [
- \y 93 12 % ]
- \y 94 7 % ^
- \y 96 12 % `
- \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\noexpand\expandafter\endgroup%
- \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
- \noexpand\else \noexpand\expandafter\noexpand\endinput%
- \noexpand\fi}%
-\expandafter\y\csname luatexbase@sty@endinput\endcsname%
-\begingroup
- \expandafter\ifx\csname ProvidesPackage\endcsname\relax
- \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
+\ifx\BeginCatcodeRegime\undefined\else\expandafter\endinput\fi
+
+\ifx
+ \ProvidesPackage\undefined\begingroup\def\ProvidesPackage
+ #1#2[#3]{\endgroup\immediate\write-1{Package: #1 #3}}
+\fi
+\ProvidesPackage{luatexbase}
+[2015/10/01 v1.0
+ luatexbase interface to LuaTeX
+]
+\edef\emuatcatcode{\the\catcode`\@}
+\catcode`\@=11
+\ifx\@setrangecatcode\@undefined
+ \ifx\RequirePackage\@undefined
+ \input{ctablestack.sty}%
\else
- \let\x\ProvidesPackage
+ \RequirePackage{ctablestack}
\fi
-\expandafter\endgroup
-\x{luatexbase}[2013/05/11 v0.6 Resource management for the LuaTeX macro programmer]
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifluatex.sty
+\fi
+\def\RequireLuaModule#1{\directlua{require("#1")}\@gobbleoptarg}
+\ifdefined\@ifnextchar
+\def\@gobbleoptarg{\@ifnextchar[\@gobble@optarg{}}%
\else
- \RequirePackage{ifluatex}
+\long\def\@gobbleoptarg#1{\ifx[#1\expandafter\@gobble@optarg\fi#1}%
\fi
-\ifluatex\else
- \begingroup
- \expandafter\ifx\csname PackageError\endcsname\relax
- \def\x#1#2#3{\begingroup \newlinechar10
- \errhelp{#3}\errmessage{Package #1 error: #2}\endgroup}
- \else
- \let\x\PackageError
- \fi
- \expandafter\endgroup
- \x{luatexbase}{LuaTeX is required for this package. Aborting.}{%
- This package can only be used with the LuaTeX engine^^J%
- (command `lualatex' or `luatex').^^J%
- Package loading has been stopped to prevent additional errors.}
- \expandafter\luatexbase@sty@endinput%
+\def\@gobble@optarg[#1]{}
+\let\CatcodeTableIniTeX\catcodetable@initex
+\let\CatcodeTableString\catcodetable@string
+\let\CatcodeTableLaTeX\catcodetable@latex
+\let\CatcodeTableLaTeXAtLetter\catcodetable@atletter
+\newcatcodetable\CatcodeTableOther
+\@setcatcodetable\CatcodeTableOther{%
+ \catcodetable\CatcodeTableString
+ \catcode32 12 }
+\newcatcodetable\CatcodeTableExpl
+\@setcatcodetable\CatcodeTableExpl{%
+ \catcodetable\CatcodeTableLaTeX
+ \catcode126 10 % tilde is a space char
+ \catcode32 9 % space is ignored
+ \catcode9 9 % tab also ignored
+ \catcode95 11 % underscore letter
+ \catcode58 11 % colon letter
+}
+\def\BeginCatcodeRegime#1{%
+ \@pushcatcodetable
+ \catcodetable#1\relax}
+\def\EndCatcodeRegime{%
+ \@popcatcodetable}
+\let\PushCatcodeTableNumStack\@pushcatcodetable
+\let\PopCatcodeTableNumStack\@popcatcodetable
+\let\SetCatcodeRange\@setrangecatcode
+\let\setcatcodetable\@setcatcodetable
+\directlua{
+function luatexbase.reset_callback(name,make_false)
+ for _,v in pairs(luatexbase.callback_descriptions(name))
+ do
+ luatexbase.remove_from_callback(name,v)
+ end
+ if make_false == true then
+ luatexbase.disable_callback(name)
+ end
+end
+luatexbase.base_add_to_callback=luatexbase.add_to_callback
+function luatexbase.add_to_callback(name,fun,description,priority)
+if(luatexbase.callbacktypes[name] == 3 and
+ priority == 1 and
+ \string#luatexbase.callback_descriptions(name)==1) then
+ luatexbase.module_warning("luatexbase",
+ "resetting exclusive callback: " .. name)
+ luatexbase.reset_callback(name)
+end
+return
+ luatexbase.base_add_to_callback(name,fun,description)
+end
+luatexbase.catcodetables=setmetatable(
+ {['latex-package'] = \number\CatcodeTableLaTeXAtLetter,
+ ini = \number\CatcodeTableIniTeX,
+ string = \number\CatcodeTableString,
+ other = \number\CatcodeTableOther,
+ latex = \number\CatcodeTableLaTeX,
+ expl = \number\CatcodeTableExpl,
+ expl3 = \number\CatcodeTableExpl},
+ { __index = function(t,key)
+ return luatexbase.registernumber(key) or nil
+ end}
+)}
+\ifnum\luatexversion<80 %
+\def\newcatcodetable#1{%
+ \e@alloc\catcodetable\chardef
+ \e@alloc@ccodetable@count\m@ne{"8000}#1%
+ \initcatcodetable\allocationnumber
+ {\escapechar=\m@ne
+ \directlua{luatexbase.catcodetables['\string#1']=%
+ \the\allocationnumber}}%
+}
\fi
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input luatex.sty
-\else
- \RequirePackage{luatex}
+\directlua{
+function luatexbase.priority_in_callback (name,description)
+ for i,v in ipairs(luatexbase.callback_descriptions(name))
+ do
+ if v == description then
+ return i
+ end
+ end
+ return false
+end
+luatexbase.is_active_callback = luatexbase.in_callback
+luatexbase.base_provides_module=luatexbase.provides_module
+function luatexbase.errwarinf(name)
+ return
+ function(s) return luatexbase.module_error(name, s) end,
+ function(s) return luatexbase.module_warning(name, s) end,
+ function(s) return luatexbase.module_info(name, s) end,
+ function(s) return luatexbase.module_info(name, s) end
+end
+function luatexbase.provides_module(info)
+ luatexbase.base_provides_module(info)
+ return luatexbase.errwarinf(info.name)
+end
+}
+\ifnum\luatexversion<80 %
+\def\newattribute#1{%
+ \e@alloc\attribute\attributedef
+ \e@alloc@attribute@count\m@ne\e@alloc@top#1%
+ {\escapechar=\m@ne
+ \directlua{luatexbase.attributes['\string#1']=%
+ \the\allocationnumber}}%
+}
\fi
-\begingroup\expandafter\expandafter\expandafter\endgroup
-\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input luatexbase-compat.sty
- \input luatexbase-modutils.sty
- \input luatexbase-loader.sty
- \input luatexbase-regs.sty
- \input luatexbase-attr.sty
- \input luatexbase-cctb.sty
- \input luatexbase-mcb.sty
-\else
- \RequirePackage{luatexbase-compat}
- \RequirePackage{luatexbase-modutils}
- \RequirePackage{luatexbase-loader}
- \RequirePackage{luatexbase-regs}
- \RequirePackage{luatexbase-attr}
- \RequirePackage{luatexbase-cctb}
- \RequirePackage{luatexbase-mcb}
+\ifx\@percentchar\@undefined
+ {\catcode`\%=12 \gdef\@percentchar{%}}
\fi
-\luatexbase@sty@endinput%
-\endinput
-%%
-%% End of file `luatexbase.sty'.
+\directlua{%
+
+local user_whatsits = { __unassociated = { } }
+local whatsit_ids = { }
+local anonymous_whatsits = 0
+local anonymous_prefix = "anon"
+local new_user_whatsit_id = function (name, package)
+ if name then
+ if not package then
+ package = unassociated
+ end
+ else % anonymous
+ anonymous_whatsits = anonymous_whatsits + 1
+ warning("defining anonymous user whatsit no. \@percentchar
+ d", anonymous_whatsits)
+ package = unassociated
+ name = anonymous_prefix .. tostring(anonymous_whatsits)
+ end
+
+ local whatsitdata = user_whatsits[package]
+ if not whatsitdata then
+ whatsitdata = { }
+ user_whatsits[package] = whatsitdata
+ end
+
+ local id = whatsitdata[name]
+ if id then %- warning
+ warning("replacing whatsit \@percentchar s:\@percentchar
+ s (\@percentchar d)", package, name, id)
+ else %- new id
+ id=luatexbase.new_whatsit(name)
+ whatsitdata[name] = id
+ whatsit_ids[id] = { name, package }
+ end
+ return id
+end
+luatexbase.new_user_whatsit_id = new_user_whatsit_id
+local new_user_whatsit = function (req, package)
+ local id, whatsit
+ if type(req) == "string" then
+ id = new_user_whatsit_id(req, package)
+ whatsit = newnode(whatsit_t, user_defined_t)
+ whatsit.user_id = id
+ elseif req.id == whatsit_t and req.subtype == user_defined_t then
+ id = req.user_id
+ whatsit = copynode(req)
+ if not whatsit_ids[id] then
+ warning("whatsit id \@percentchar d unregistered; "
+ .. "inconsistencies may arise", id)
+ end
+ end
+ return function () return copynode(whatsit) end, id
+end
+luatexbase.new_user_whatsit = new_user_whatsit
+local get_user_whatsit_id = function (name, package)
+ if not package then
+ package = unassociated
+ end
+ return user_whatsits[package][name]
+end
+luatexbase.get_user_whatsit_id = get_user_whatsit_id
+local get_user_whatsit_name = function (asked)
+ local id
+ if type(asked) == "number" then
+ id = asked
+ elseif type(asked) == "function" then
+ %- node generator
+ local n = asked()
+ id = n.user_id
+ else %- node
+ id = asked.user_id
+ end
+ local metadata = whatsit_ids[id]
+ if not metadata then % unknown
+ warning("whatsit id \@percentchar d unregistered;
+ inconsistencies may arise", id)
+ return "", ""
+ end
+ return tableunpack(metadata)
+end
+luatexbase.get_user_whatsit_name = get_user_whatsit_name
+local dump_registered_whatsits = function (asked_package)
+ local whatsit_list = { }
+ if asked_package then
+ local whatsitdata = user_whatsits[asked_package]
+ if not whatsitdata then
+ error("(no user whatsits registered for package
+ \@percentchar s)", asked_package)
+ return
+ end
+ texiowrite_nl("(user whatsit allocation stats for " ..
+ asked_package)
+ for name, id in next, whatsitdata do
+ whatsit_list[\string#whatsit_list+1] =
+ stringformat("(\@percentchar s:\@percentchar
+ s \@percentchar d)", asked_package, name, id)
+ end
+ else
+ texiowrite_nl("(user whatsit allocation stats")
+ texiowrite_nl(stringformat(" ((total \@percentchar d)\string\n
+ (anonymous \@percentchar d))",
+ current_whatsit, anonymous_whatsits))
+ for package, whatsitdata in next, user_whatsits do
+ for name, id in next, whatsitdata do
+ whatsit_list[\string#whatsit_list+1] =
+ stringformat("(\@percentchar s:\@percentchar
+ s \@percentchar d)", package, name, id)
+ end
+ end
+ end
+ texiowrite_nl" ("
+ local first = true
+ for i=1, \string#whatsit_list do
+ if first then
+ first = false
+ else % indent
+ texiowrite_nl" "
+ end
+ texiowrite(whatsit_list[i])
+ end
+ texiowrite"))\string\n"
+end
+luatexbase.dump_registered_whatsits = dump_registered_whatsits
+luatexbase.newattribute = new_attribute
+luatexbase.newuserwhatsit = new_user_whatsit
+luatexbase.newuserwhatsitid = new_user_whatsit_id
+luatexbase.getuserwhatsitid = get_user_whatsit_id
+luatexbase.getuserwhatsitname = get_user_whatsit_name
+luatexbase.dumpregisteredwhatsits = dump_registered_whatsits
+}
+\let\newluatexattribute\newattribute
+\let\setluatexattribute\setattribute
+\let\unsetluatexattribute\unsetattribute
+\let\newluatexcatcodetable\newcatcodetable
+\let\setluatexcatcodetable\setcatcodetable
+\let\luatexbase@directlua\directlua
+\let\luatexbase@ensure@primitive\@gobble
+\let\luatexattribute\attribute
+\let\luatexattributedef\attributedef
+\let\luatexcatcodetable\catcodetable
+\let\luatexluaescapestring\luaescapestring
+\let\luatexlatelua\latelua
+\let\luatexoutputbox\outputbox
+\let\luatexscantextokens\scantextokens
+\catcode`\@=\emuatcatcode\relax
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/mcb.lua b/Master/texmf-dist/tex/luatex/luatexbase/mcb.lua
deleted file mode 100644
index ae9e8a78523..00000000000
--- a/Master/texmf-dist/tex/luatex/luatexbase/mcb.lua
+++ /dev/null
@@ -1,313 +0,0 @@
---
--- This is file `mcb.lua',
--- generated with the docstrip utility.
---
--- The original source files were:
---
--- luatexbase-mcb.dtx (with options: `lua')
---
--- See the aforementioned source file(s) for copyright and licensing information.
---
-luatexbase = luatexbase or { }
-local luatexbase = luatexbase
-local err, warning, info, log = luatexbase.provides_module({
- name = "luatexbase-mcb",
- version = 0.6,
- date = "2013/05/11",
- description = "register several functions in a callback",
- author = "Hans Hagen, Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang",
- copyright = "Hans Hagen, Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang",
- license = "CC0",
-})
-local add_to_callback
-local call_callback
-local create_callback
-local priority_in_callback
-local remove_from_callback
-local reset_callback
-local callbacklist = callbacklist or { }
-local list, data, first, simple = 1, 2, 3, 4
-local types = {
- list = list,
- data = data,
- first = first,
- simple = simple,
-}
-local callbacktypes = callbacktypes or {
- find_read_file = first,
- find_write_file = first,
- find_font_file = data,
- find_output_file = data,
- find_format_file = data,
- find_vf_file = data,
- find_ocp_file = data,
- find_map_file = data,
- find_enc_file = data,
- find_sfd_file = data,
- find_pk_file = data,
- find_data_file = data,
- find_opentype_file = data,
- find_truetype_file = data,
- find_type1_file = data,
- find_image_file = data,
- open_read_file = first,
- read_font_file = first,
- read_vf_file = first,
- read_ocp_file = first,
- read_map_file = first,
- read_enc_file = first,
- read_sfd_file = first,
- read_pk_file = first,
- read_data_file = first,
- read_truetype_file = first,
- read_type1_file = first,
- read_opentype_file = first,
- process_input_buffer = data,
- process_output_buffer = data,
- token_filter = first,
- buildpage_filter = simple,
- pre_linebreak_filter = list,
- linebreak_filter = list,
- post_linebreak_filter = list,
- hpack_filter = list,
- vpack_filter = list,
- pre_output_filter = list,
- hyphenate = simple,
- ligaturing = simple,
- kerning = simple,
- mlist_to_hlist = list,
- start_run = simple,
- stop_run = simple,
- start_page_number = simple,
- stop_page_number = simple,
- show_error_hook = simple,
- define_font = first,
-}
-local lua_callbacks_defaults = { }
-local original_register = original_register or callback.register
-callback.register = function ()
- err("function callback.register has been trapped,\n"
- .."please use luatexbase.add_to_callback instead.")
-end
-local function register_callback(...)
- return assert(original_register(...))
-end
-local function listhandler (name)
- return function(head,...)
- local ret
- local alltrue = true
- for _, f in ipairs(callbacklist[name]) do
- ret = f.func(head, ...)
- if ret == false then
- warning("function '%s' returned false\nin callback '%s'",
- f.description, name)
- break
- end
- if ret ~= true then
- alltrue = false
- head = ret
- end
- end
- return alltrue and true or head
- end
-end
-local function datahandler (name)
- return function(data, ...)
- for _, f in ipairs(callbacklist[name]) do
- data = f.func(data, ...)
- end
- return data
- end
-end
-local function firsthandler (name)
- return function(...)
- return callbacklist[name][1].func(...)
- end
-end
-local function simplehandler (name)
- return function(...)
- for _, f in ipairs(callbacklist[name]) do
- f.func(...)
- end
- end
-end
-local handlers = {
- [list] = listhandler,
- [data] = datahandler,
- [first] = firsthandler,
- [simple] = simplehandler,
-}
-function add_to_callback (name,func,description,priority)
- if type(func) ~= "function" then
- return err("unable to add function:\nno proper function passed")
- end
- if not name or name == "" then
- err("unable to add function:\nno proper callback name passed")
- return
- elseif not callbacktypes[name] then
- err("unable to add function:\n'%s' is not a valid callback", name)
- return
- end
- if not description or description == "" then
- err("unable to add function to '%s':\nno proper description passed",
- name)
- return
- end
- if priority_in_callback(name, description) then
- err("function '%s' already registered\nin callback '%s'",
- description, name)
- return
- end
- local l = callbacklist[name]
- if not l then
- l = {}
- callbacklist[name] = l
- if not lua_callbacks_defaults[name] then
- register_callback(name, handlers[callbacktypes[name]](name))
- end
- end
- local f = {
- func = func,
- description = description,
- }
- priority = tonumber(priority)
- if not priority or priority > #l then
- priority = #l+1
- elseif priority < 1 then
- priority = 1
- end
- table.insert(l,priority,f)
- if callbacktypes[name] == first and #l ~= 1 then
- warning("several functions in '%s',\n"
- .."only one will be active.", name)
- end
- log("inserting '%s'\nat position %s in '%s'",
- description, priority, name)
-end
-luatexbase.add_to_callback = add_to_callback
-function remove_from_callback (name, description)
- if not name or name == "" then
- err("unable to remove function:\nno proper callback name passed")
- return
- elseif not callbacktypes[name] then
- err("unable to remove function:\n'%s' is not a valid callback", name)
- return
- end
- if not description or description == "" then
- err(
- "unable to remove function from '%s':\nno proper description passed",
- name)
- return
- end
- local l = callbacklist[name]
- if not l then
- err("no callback list for '%s'",name)
- return
- end
- local index = false
- for k,v in ipairs(l) do
- if v.description == description then
- index = k
- break
- end
- end
- if not index then
- err("unable to remove '%s'\nfrom '%s'", description, name)
- return
- end
- table.remove(l, index)
- log("removing '%s'\nfrom '%s'", description, name)
- if #l == 0 then
- callbacklist[name] = nil
- if not lua_callbacks_defaults[name] then
- register_callback(name, nil)
- end
- end
- return
-end
-luatexbase.remove_from_callback = remove_from_callback
-function reset_callback (name, make_false)
- if not name or name == "" then
- err("unable to reset:\nno proper callback name passed")
- return
- elseif not callbacktypes[name] then
- err("unable to reset '%s':\nis not a valid callback", name)
- return
- end
- log("resetting callback '%s'", name)
- callbacklist[name] = nil
- if not lua_callbacks_defaults[name] then
- if make_false == true then
- log("setting '%s' to false", name)
- register_callback(name, false)
- else
- register_callback(name, nil)
- end
- end
-end
-luatexbase.reset_callback = reset_callback
-function priority_in_callback (name, description)
- if not name or name == ""
- or not callbacktypes[name]
- or not description then
- return false
- end
- local l = callbacklist[name]
- if not l then return false end
- for p, f in pairs(l) do
- if f.description == description then
- return p
- end
- end
- return false
-end
-luatexbase.priority_in_callback = priority_in_callback
-function create_callback(name, ctype, default)
- if not name then
- err("unable to call callback:\nno proper name passed", name)
- return nil
- end
- if not ctype or not default then
- err("unable to create callback '%s':\n"
- .."callbacktype or default function not specified", name)
- return nil
- end
- if callbacktypes[name] then
- err("unable to create callback '%s':\ncallback already exists", name)
- return nil
- end
- ctype = types[ctype]
- if not ctype then
- err("unable to create callback '%s':\ntype '%s' undefined", name, ctype)
- return nil
- end
- log("creating '%s' type %s", name, ctype)
- lua_callbacks_defaults[name] = default
- callbacktypes[name] = ctype
-end
-luatexbase.create_callback = create_callback
-function call_callback(name, ...)
- if not name then
- err("unable to call callback:\nno proper name passed", name)
- return nil
- end
- if not lua_callbacks_defaults[name] then
- err("unable to call lua callback '%s':\nunknown callback", name)
- return nil
- end
- local l = callbacklist[name]
- local f
- if not l then
- f = lua_callbacks_defaults[name]
- else
- f = handlers[callbacktypes[name]](name)
- if not f then
- err("unknown callback type")
- return
- end
- end
- return f(...)
-end
-luatexbase.call_callback = call_callback
---
--- End of File `mcb.lua'.
diff --git a/Master/texmf-dist/tex/luatex/luatexbase/modutils.lua b/Master/texmf-dist/tex/luatex/luatexbase/modutils.lua
deleted file mode 100644
index 1c5b5ca1488..00000000000
--- a/Master/texmf-dist/tex/luatex/luatexbase/modutils.lua
+++ /dev/null
@@ -1,150 +0,0 @@
---
--- This is file `modutils.lua',
--- generated with the docstrip utility.
---
--- The original source files were:
---
--- luatexbase-modutils.dtx (with options: `luamodule')
---
--- See the aforementioned source file(s) for copyright and licensing information.
---
-luatexbase = luatexbase or { }
-local luatexbase = luatexbase
-local string_gsub = string.gsub
-local modules = modules or {}
-local function date_to_int(date)
- if date == '' then return -1 end
- local numbers = string_gsub(date, "(%d+)/(%d+)/(%d+)", "%1%2%3")
- return tonumber(numbers)
-end
-local function msg_format(msg_type, mod_name, ...)
- local cont = '('..mod_name..')' .. ('Module: '..msg_type):gsub('.', ' ')
- return 'Module '..mod_name..' '..msg_type..': '
- .. string.format(...):gsub('\n', '\n'..cont) .. '\n'
-end
-local function module_error_int(mod, ...)
- error(msg_format('error', mod, ...), 3)
-end
-local function module_error(mod, ...)
- module_error_int(mod, ...)
-end
-luatexbase.module_error = module_error
-local function module_warning(mod, ...)
- for _, line in ipairs(msg_format('warning', mod, ...):explode('\n')) do
- texio.write_nl(line)
- end
-end
-luatexbase.module_warning = module_warning
-local function module_info(mod, ...)
- for _, line in ipairs(msg_format('info', mod, ...):explode('\n')) do
- texio.write_nl(line)
- end
-end
-luatexbase.module_info = module_info
-local function module_log(mod, msg, ...)
- texio.write_nl('log', mod..': '..msg:format(...))
-end
-luatexbase.module_log = module_log
-local function errwarinf(name)
- return function(...) module_error_int(name, ...) end,
- function(...) module_warning(name, ...) end,
- function(...) module_info(name, ...) end,
- function(...) module_log(name, ...) end
-end
-luatexbase.errwarinf = errwarinf
-local err, warn = errwarinf('luatexbase.modutils')
-local function require_module(name, req_date)
- require(name)
- local info = modules[name]
- if not info then
- warn("module '%s' was not properly identified", name)
- elseif req_date and info.date then
- if date_to_int(info.date) < date_to_int(req_date) then
- warn("module '%s' required in version '%s'\n"
- .. "but found in version '%s'", name, req_date, info.date)
- end
- end
-end
-luatexbase.require_module = require_module
-local function provides_module(info)
- if not (info and info.name) then
- err('provides_module: missing information')
- end
- texio.write_nl('log', string.format("Lua module: %s %s %s %s\n",
- info.name, info.date or '', info.version or '', info.description or ''))
- modules[info.name] = info
- return errwarinf(info.name)
-end
-luatexbase.provides_module = provides_module
-local fastcopy
-fastcopy = table.fastcopy or function(old)
- if old then
- local new = { }
- for k,v in next, old do
- if type(v) == "table" then
- new[k] = fastcopy(v)
- else
- new[k] = v
- end
- end
- local mt = getmetatable(old)
- if mt then
- setmetatable(new,mt)
- end
- return new
- else
- return { }
- end
-end
-local function get_module_info(name)
- local module_table = modules[name]
- if not module_table then
- return nil
- else
- return fastcopy(module_table)
- end
-end
-luatexbase.get_module_info = get_module_info
-function get_module_version(name)
- local module_table = modules[name]
- if not module_table then
- return nil
- else
- return module_table.version
- end
-end
-luatexbase.get_module_version = get_module_version
-function get_module_date(name)
- local module_table = modules[name]
- if not module_table then
- return nil
- else
- return module_table.date
- end
-end
-luatexbase.get_module_date = get_module_date
-function get_module_date_int(name)
- local module_table = modules[name]
- if not module_table then
- return nil
- else
- return module_table.date and date_to_int(module_table.date)
- end
-end
-luatexbase.get_module_date_int = get_module_date_int
-function is_module_loaded(name)
- if modules[name] then
- return true
- else
- return false
- end
-end
-luatexbase.is_module_loaded = is_module_loaded
-provides_module({
- name = 'luatexbase-modutils',
- date = '2013/05/11',
- version = 0.6,
- description = 'Module utilities for LuaTeX',
-})
---
--- End of File `modutils.lua'.