summaryrefslogtreecommitdiff
path: root/tex/context/base
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkiv/back-lua.lua1
-rw-r--r--tex/context/base/mkiv/back-mps.lua1
-rw-r--r--tex/context/base/mkiv/buff-ini.lua2
-rw-r--r--tex/context/base/mkiv/cldf-int.lua12
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv4
-rw-r--r--tex/context/base/mkiv/context.mkxl6
-rw-r--r--tex/context/base/mkiv/driv-shp.lua1
-rw-r--r--tex/context/base/mkiv/font-cff.lua1
-rw-r--r--tex/context/base/mkiv/font-dsp.lua1
-rw-r--r--tex/context/base/mkiv/font-map.lua1
-rw-r--r--tex/context/base/mkiv/font-nod.lua1
-rw-r--r--tex/context/base/mkiv/font-one.lua1
-rw-r--r--tex/context/base/mkiv/font-onr.lua1
-rw-r--r--tex/context/base/mkiv/font-otd.lua1
-rw-r--r--tex/context/base/mkiv/font-otj.lua1
-rw-r--r--tex/context/base/mkiv/font-otr.lua1
-rw-r--r--tex/context/base/mkiv/font-ots.lua29
-rw-r--r--tex/context/base/mkiv/font-sol.lua8
-rw-r--r--tex/context/base/mkiv/font-tpk.lua3
-rw-r--r--tex/context/base/mkiv/font-ttf.lua1
-rw-r--r--tex/context/base/mkiv/grph-inc.lua1
-rw-r--r--tex/context/base/mkiv/l-unicode.lua1
-rw-r--r--tex/context/base/mkiv/libs-imp-kpse.lua58
-rw-r--r--tex/context/base/mkiv/libs-imp-kpse.mkxl38
-rw-r--r--tex/context/base/mkiv/libs-ini.lua10
-rw-r--r--tex/context/base/mkiv/lpdf-emb.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-eng.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-img.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-ini.lua1
-rw-r--r--tex/context/base/mkiv/lpdf-lmt.lua1
-rw-r--r--tex/context/base/mkiv/lxml-aux.lua1
-rw-r--r--tex/context/base/mkiv/math-map.lua1
-rw-r--r--tex/context/base/mkiv/math-noa.lua1
-rw-r--r--tex/context/base/mkiv/mlib-cnt.lua1
-rw-r--r--tex/context/base/mkiv/mlib-svg.lua1
-rw-r--r--tex/context/base/mkiv/mult-low.lua1
-rw-r--r--tex/context/base/mkiv/node-bck.lua1
-rw-r--r--tex/context/base/mkiv/node-cmp.lua2
-rw-r--r--tex/context/base/mkiv/node-fin.lua1
-rw-r--r--tex/context/base/mkiv/node-ini.lua66
-rw-r--r--tex/context/base/mkiv/node-ltp.lua5
-rw-r--r--tex/context/base/mkiv/node-ref.lua1
-rw-r--r--tex/context/base/mkiv/node-rul.lua1
-rw-r--r--tex/context/base/mkiv/node-shp.lua1
-rw-r--r--tex/context/base/mkiv/pack-rul.lua1
-rw-r--r--tex/context/base/mkiv/spac-ali.lua1
-rw-r--r--tex/context/base/mkiv/spac-chr.lua1
-rw-r--r--tex/context/base/mkiv/spac-ver.lua1
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin27757 -> 27742 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin255013 -> 255197 bytes
-rw-r--r--tex/context/base/mkiv/supp-box.lua1
-rw-r--r--tex/context/base/mkiv/syst-ini.mkiv1
-rw-r--r--tex/context/base/mkiv/syst-lua.lua49
-rw-r--r--tex/context/base/mkiv/tabl-tbl.mkiv2
-rw-r--r--tex/context/base/mkiv/tabl-tbl.mkxl11
-rw-r--r--tex/context/base/mkiv/tabl-xtb.lua2
-rw-r--r--tex/context/base/mkiv/toks-aux.lua88
-rw-r--r--tex/context/base/mkiv/toks-aux.mkiv15
-rw-r--r--tex/context/base/mkiv/toks-ini.lua121
-rw-r--r--tex/context/base/mkiv/toks-tra.lua293
-rw-r--r--tex/context/base/mkiv/toks-tra.mkiv34
-rw-r--r--tex/context/base/mkiv/trac-vis.lua1
-rw-r--r--tex/context/base/mkiv/typo-cap.lua1
-rw-r--r--tex/context/base/mkiv/typo-dha.lua34
-rw-r--r--tex/context/base/mkiv/typo-dig.lua1
-rw-r--r--tex/context/base/mkiv/typo-dua.lua6
-rw-r--r--tex/context/base/mkiv/typo-dub.lua6
-rw-r--r--tex/context/base/mkiv/typo-duc.lua6
-rw-r--r--tex/context/base/mkiv/util-fil.lua1
-rw-r--r--tex/context/base/mkiv/util-sac.lua1
73 files changed, 434 insertions, 524 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 787c827ac..6a5882366 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2020.07.09 14:48}
+\newcontextversion{2020.07.13 16:23}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index cb34f163c..b087acf4f 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.07.09 14:48}
+\edef\contextversion{2020.07.13 16:23}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/back-lua.lua b/tex/context/base/mkiv/back-lua.lua
index 4e95d37e3..87093afd4 100644
--- a/tex/context/base/mkiv/back-lua.lua
+++ b/tex/context/base/mkiv/back-lua.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['back-lua'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/back-mps.lua b/tex/context/base/mkiv/back-mps.lua
index 96c850ed6..13a0d6d42 100644
--- a/tex/context/base/mkiv/back-mps.lua
+++ b/tex/context/base/mkiv/back-mps.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['back-mps'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/buff-ini.lua b/tex/context/base/mkiv/buff-ini.lua
index b4290f8b1..4589e5498 100644
--- a/tex/context/base/mkiv/buff-ini.lua
+++ b/tex/context/base/mkiv/buff-ini.lua
@@ -44,7 +44,7 @@ local gettoken = getters.token
local getcommand = token.get_command
local getcsname = token.get_csname
-local getnextchar = token.get_next_char
+local getnextchar = token.scan_next_char or token.get_next_char
local variables = interfaces.variables
local settings_to_array = utilities.parsers.settings_to_array
diff --git a/tex/context/base/mkiv/cldf-int.lua b/tex/context/base/mkiv/cldf-int.lua
index d869f3154..47f825a4a 100644
--- a/tex/context/base/mkiv/cldf-int.lua
+++ b/tex/context/base/mkiv/cldf-int.lua
@@ -35,7 +35,7 @@ if CONTEXTLMTXMODE > 0 then
local scanners = tokens.scanners
local shortcuts = tokens.shortcuts
- local scanpeek = scanners.peek
+ local peekchar = scanners.peekchar
local scankey = scanners.key
local scanvalue = scanners.value
local scanskip = scanners.skip
@@ -46,11 +46,11 @@ if CONTEXTLMTXMODE > 0 then
local comma = byte(',')
function scanhash(scanners)
- if scanpeek() == open then
+ if peekchar() == open then
local data = { }
scanskip()
while true do
- local c = scanpeek()
+ local c = peekchar()
if c == comma then
scanskip()
elseif c == close then
@@ -59,7 +59,7 @@ if CONTEXTLMTXMODE > 0 then
else
local key = scankey(equal)
if key then
- if scanpeek() == equal then
+ if peekchar() == equal then
scanskip()
if scanners then
local scanner = scanners[key]
@@ -84,12 +84,12 @@ if CONTEXTLMTXMODE > 0 then
end
function scanarray()
- if scanpeek() == open then
+ if peekchar() == open then
local data = { }
local d = 0
scanskip()
while true do
- local c = scanpeek()
+ local c = peekchar()
if c == comma then
scanskip()
elseif c == close then
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 4b09e1699..f41893ad6 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2020.07.09 14:48}
+\newcontextversion{2020.07.13 16:23}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index f2fc78609..4ce7764ff 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.07.09 14:48}
+\edef\contextversion{2020.07.13 16:23}
%D Kind of special:
@@ -160,7 +160,7 @@
% \loadmarkfile{luat-ini}
-\loadmarkfile{toks-tra}
+%loadmarkfile{toks-tra}
\loadmarkfile{toks-aux}
%loadmarkfile{toks-map} % obsolete, never used
diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl
index 6af3d0f0b..9f3235584 100644
--- a/tex/context/base/mkiv/context.mkxl
+++ b/tex/context/base/mkiv/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.07.09 14:48}
+\edef\contextversion{2020.07.13 16:23}
%D Kind of special:
@@ -144,11 +144,7 @@
\loadmarkfile{trac-ctx} % maybe move up
-% \loadmarkfile{luat-ini}
-
-\loadmarkfile{toks-tra}
\loadmarkfile{toks-aux}
-%loadmarkfile{toks-map} % obsolete, never used
\loadmarkfile{attr-ini}
diff --git a/tex/context/base/mkiv/driv-shp.lua b/tex/context/base/mkiv/driv-shp.lua
index 471fa92f0..a23cca3a8 100644
--- a/tex/context/base/mkiv/driv-shp.lua
+++ b/tex/context/base/mkiv/driv-shp.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['driv-shp'] = {
version = 1.001,
+ optimize = true,
comment = "companion to driv-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-cff.lua b/tex/context/base/mkiv/font-cff.lua
index 627847efa..c2cf0e699 100644
--- a/tex/context/base/mkiv/font-cff.lua
+++ b/tex/context/base/mkiv/font-cff.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-cff'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-dsp.lua b/tex/context/base/mkiv/font-dsp.lua
index f8794bcde..0cff896e8 100644
--- a/tex/context/base/mkiv/font-dsp.lua
+++ b/tex/context/base/mkiv/font-dsp.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-dsp'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-map.lua b/tex/context/base/mkiv/font-map.lua
index 84a28a8b7..990a561f9 100644
--- a/tex/context/base/mkiv/font-map.lua
+++ b/tex/context/base/mkiv/font-map.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-map'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-nod.lua b/tex/context/base/mkiv/font-nod.lua
index 8c0f6e441..ad61d7111 100644
--- a/tex/context/base/mkiv/font-nod.lua
+++ b/tex/context/base/mkiv/font-nod.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-nod'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-one.lua b/tex/context/base/mkiv/font-one.lua
index 5387516b4..a76c92985 100644
--- a/tex/context/base/mkiv/font-one.lua
+++ b/tex/context/base/mkiv/font-one.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-one'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-onr.lua b/tex/context/base/mkiv/font-onr.lua
index fc6bead58..c33b09f9e 100644
--- a/tex/context/base/mkiv/font-onr.lua
+++ b/tex/context/base/mkiv/font-onr.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-onr'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-otd.lua b/tex/context/base/mkiv/font-otd.lua
index 2633c6cae..3f1b212db 100644
--- a/tex/context/base/mkiv/font-otd.lua
+++ b/tex/context/base/mkiv/font-otd.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-otd'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua
index bec52d813..bb02044dc 100644
--- a/tex/context/base/mkiv/font-otj.lua
+++ b/tex/context/base/mkiv/font-otj.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-otj'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-otr.lua b/tex/context/base/mkiv/font-otr.lua
index bad42054f..119687f12 100644
--- a/tex/context/base/mkiv/font-otr.lua
+++ b/tex/context/base/mkiv/font-otr.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-otr'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index 86101ee24..490f28de6 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-ots'] = { -- sequences
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -252,6 +253,9 @@ local math_code = nodecodes.math
local dir_code = nodecodes.dir
local localpar_code = nodecodes.localpar
+local lefttoright_code = nodes.dirvalues.lefttoright
+local righttoleft_code = nodes.dirvalues.righttoleft
+
local discretionarydisc_code = disccodes.discretionary
local ligatureglyph_code = glyphcodes.ligature
@@ -3625,8 +3629,6 @@ end
local txtdirstate, pardirstate do -- this might change (no need for nxt in pardirstate)
local getdirection = nuts.getdirection
- local lefttoright = 0
- local righttoleft = 1
txtdirstate = function(start,stack,top,rlparmode)
local dir, pop = getdirection(start)
@@ -3635,19 +3637,19 @@ local txtdirstate, pardirstate do -- this might change (no need for nxt in pard
return 0, rlparmode
else
top = top - 1
- if stack[top] == righttoleft then
+ if stack[top] == righttoleft_code then
return top, -1
else
return top, 1
end
end
- elseif dir == lefttoright then
+ elseif dir == lefttoright_code then
top = top + 1
- stack[top] = lefttoright
+ stack[top] = lefttoright_code
return top, 1
- elseif dir == righttoleft then
+ elseif dir == righttoleft_code then
top = top + 1
- stack[top] = righttoleft
+ stack[top] = righttoleft_code
return top, -1
else
return top, rlparmode
@@ -3656,14 +3658,9 @@ local txtdirstate, pardirstate do -- this might change (no need for nxt in pard
pardirstate = function(start)
local dir = getdirection(start)
- if dir == lefttoright then
- return 1, 1
- elseif dir == righttoleft then
- return -1, -1
- -- for old times sake we we handle strings too
- elseif dir == "TLT" then
+ if dir == lefttoright_code then
return 1, 1
- elseif dir == "TRT" then
+ elseif dir == righttoleft_code then
return -1, -1
else
return 0, 0
@@ -3764,7 +3761,7 @@ do
if getid(head) == localpar_code and start_of_par(head) then
initialrl = pardirstate(head)
- elseif direction == 1 or direction == "TRT" then
+ elseif direction == righttoleft_code then
initialrl = -1
end
@@ -4059,7 +4056,7 @@ do
local done = false
local dirstack = { nil } -- could move outside function but we can have local runs (maybe a few more nils)
local start = head
- local initialrl = (direction == 1 or direction == "TRT") and -1 or 0
+ local initialrl = (direction == righttoleft_code) and -1 or 0
local rlmode = initialrl
local rlparmode = initialrl
local topstack = 0
diff --git a/tex/context/base/mkiv/font-sol.lua b/tex/context/base/mkiv/font-sol.lua
index 2017afcb2..643080788 100644
--- a/tex/context/base/mkiv/font-sol.lua
+++ b/tex/context/base/mkiv/font-sol.lua
@@ -111,6 +111,8 @@ local whatsit_code = nodecodes.whatsit
local fontkern_code = kerncodes.fontkern
+local righttoleft_code = nodes.dirvalues.righttoleft
+
local userdefinedwhatsit_code = whatsitcodes.userdefined
local nodeproperties = nodes.properties.data
@@ -379,7 +381,7 @@ function splitters.split(head) -- best also pass the direction
end
end
if r2l then
- local dirnode = new_direction(righttoleft) -- brrr, we don't pop ... to be done (when used at all)
+ local dirnode = new_direction(righttoleft_code) -- brrr, we don't pop ... to be done (when used at all)
setlink(dirnode,list)
list = dirnode
end
@@ -434,13 +436,13 @@ function splitters.split(head) -- best also pass the direction
flush()
end
local direction, pop = getdirection(current)
- r2l = not pop and direction == righttoleft
+ r2l = not pop and direction == righttoleft_code
elseif id == localpar_code and start_of_par(current) then
if start then
flush() -- very unlikely as this starts a paragraph
end
local direction = getdirection(current)
- r2l = direction == righttoleft or direction == "TRT" -- for old times sake
+ r2l = direction == righttoleft_code
else
if start then
flush()
diff --git a/tex/context/base/mkiv/font-tpk.lua b/tex/context/base/mkiv/font-tpk.lua
index 05ecdd45c..c24af1df8 100644
--- a/tex/context/base/mkiv/font-tpk.lua
+++ b/tex/context/base/mkiv/font-tpk.lua
@@ -1,5 +1,6 @@
- if not modules then modules = { } end modules ['font-tpk'] = {
+if not modules then modules = { } end modules ['font-tpk'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/font-ttf.lua b/tex/context/base/mkiv/font-ttf.lua
index 651ede17e..865f8e6e3 100644
--- a/tex/context/base/mkiv/font-ttf.lua
+++ b/tex/context/base/mkiv/font-ttf.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['font-ttf'] = {
version = 1.001,
+ optimize = true,
comment = "companion to font-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua
index a59ac8ac2..508f3247a 100644
--- a/tex/context/base/mkiv/grph-inc.lua
+++ b/tex/context/base/mkiv/grph-inc.lua
@@ -1377,7 +1377,6 @@ function figures.dummy(data)
du.width = du.width or figures.defaultwidth
du.height = du.height or figures.defaultheight
du.depth = du.depth or figures.defaultdepth
- -- box.dir = "TLT"
box.width = du.width
box.height = du.height
box.depth = du.depth
diff --git a/tex/context/base/mkiv/l-unicode.lua b/tex/context/base/mkiv/l-unicode.lua
index c57aaf33e..03016ed90 100644
--- a/tex/context/base/mkiv/l-unicode.lua
+++ b/tex/context/base/mkiv/l-unicode.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['l-unicode'] = {
version = 1.001,
+ optimize = true,
comment = "companion to luat-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/libs-imp-kpse.lua b/tex/context/base/mkiv/libs-imp-kpse.lua
new file mode 100644
index 000000000..f8e4a9907
--- /dev/null
+++ b/tex/context/base/mkiv/libs-imp-kpse.lua
@@ -0,0 +1,58 @@
+if not modules then modules = { } end modules ['libs-imp-kpse'] = {
+ version = 1.001,
+ comment = "companion to luat-imp-kpse.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This is an experiment. It might make sense to have this available in case I want
+-- more runners to use LuaMetaTeX in which case (as with mtxrun using LuaTeX) we
+-- need to load kpse.
+
+local libname = "kpse"
+local libfile = (os.platform == "win64" and "kpathsea*w64")
+ or (os.platform == "win32" and "kpathsea*w32")
+ or "libkpathsea"
+local libkpse = resolvers.libraries.validoptional(libname)
+
+if package.loaded[libname] then
+ return package.loaded[libname]
+end
+
+-- This is a variant that loaded directly:
+
+-- kpse = libkpse -- the library will issue warnings anyway
+--
+-- resolvers.libraries.optionalloaded(libname,libfile) -- no need to chedk if true
+
+-- This variant delays loading and has a bit more protection:
+
+local function okay()
+ if libkpse and resolvers.libraries.optionalloaded(libname,libfile) then
+ okay = function() return true end
+ else
+ okay = function() return false end
+ end
+ return okay()
+end
+
+local kpse = { }
+
+for k, v in next, libkpse do
+ kpse[k] = function(...) if okay() then return v(...) end end
+end
+
+-- We properly register the module:
+
+package.loaded[libname] = kpse
+
+optional.loaded.kpse = kpse
+
+-- A simple test:
+
+-- kpse.set_program_name("pdftex")
+-- print("find file:",kpse.find_file("oeps.tex"))
+-- print("find file:",kpse.find_file("context.mkii"))
+
+return kpse
diff --git a/tex/context/base/mkiv/libs-imp-kpse.mkxl b/tex/context/base/mkiv/libs-imp-kpse.mkxl
new file mode 100644
index 000000000..8a3d7826f
--- /dev/null
+++ b/tex/context/base/mkiv/libs-imp-kpse.mkxl
@@ -0,0 +1,38 @@
+%D \module
+%D [ file=libs-imp-kpse,
+%D version=2020.05.19,
+%D title=\CONTEXT\ System Modules,
+%D subtitle=KPSE File Searching,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This is not really a module. It's more some left over from an experiment. Who
+%D know when it comes in handy; probably never in a real run, but I might want to
+%D make a \LUAMETATEX\ plain format one day, just for the fun of it.
+
+% \registerctxluafile{libs-imp-kpse}{}
+
+\continueifinputfile{libs-imp-kpse.mkxl}
+
+\starttext
+
+\startTEXpage
+ \startluacode
+ local kpse = require("libs-imp-kpse")
+
+ kpse.set_program_name("pdftex")
+
+ local name = "context.mkii"
+
+ context("%s: %s",name,kpse.find_file(name))
+ \stopluacode
+\stopTEXpage
+
+\stoptext
+
+
diff --git a/tex/context/base/mkiv/libs-ini.lua b/tex/context/base/mkiv/libs-ini.lua
index 2bac3201d..5fc8ded98 100644
--- a/tex/context/base/mkiv/libs-ini.lua
+++ b/tex/context/base/mkiv/libs-ini.lua
@@ -30,8 +30,10 @@ local expandpaths = resolvers.expandedpathlistfromvariable
local report = logs.reporter("resolvers","libraries")
local trace = false
+local silent = false
-trackers.register("resolvers.lib", function(v) trace = v end)
+trackers.register("resolvers.lib", function(v) trace = v end)
+trackers.register("resolvers.lib.silent", function(v) silent = v end)
local function findlib(required) -- todo: cache
local suffix = os.libsuffix or "so"
@@ -143,10 +145,10 @@ function libraries.optionalloaded(name,libnames)
end
end
local initialized = thelib_initialize(unpack(libnames))
- if initialized then
- report("using library '% + t'",libnames)
- else
+ if not initialized then
report("unable to initialize library '% + t'",libnames)
+ elseif not silent then
+ report("using library '% + t'",libnames)
end
return initialized
end
diff --git a/tex/context/base/mkiv/lpdf-emb.lua b/tex/context/base/mkiv/lpdf-emb.lua
index 4ffcfd8a8..0f0388af0 100644
--- a/tex/context/base/mkiv/lpdf-emb.lua
+++ b/tex/context/base/mkiv/lpdf-emb.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['lpdf-ini'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/lpdf-eng.lua b/tex/context/base/mkiv/lpdf-eng.lua
index 21c7e66e9..26a63e9a0 100644
--- a/tex/context/base/mkiv/lpdf-eng.lua
+++ b/tex/context/base/mkiv/lpdf-eng.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['lpdf-eng'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/lpdf-img.lua b/tex/context/base/mkiv/lpdf-img.lua
index 17305a1cf..fc53740f6 100644
--- a/tex/context/base/mkiv/lpdf-img.lua
+++ b/tex/context/base/mkiv/lpdf-img.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['lpdf-img'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua
index c6dd4765e..8ece39cee 100644
--- a/tex/context/base/mkiv/lpdf-ini.lua
+++ b/tex/context/base/mkiv/lpdf-ini.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['lpdf-ini'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/lpdf-lmt.lua b/tex/context/base/mkiv/lpdf-lmt.lua
index 90e1fcea2..5a1a6bc44 100644
--- a/tex/context/base/mkiv/lpdf-lmt.lua
+++ b/tex/context/base/mkiv/lpdf-lmt.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['lpdf-lmt'] = {
version = 1.001,
+ optimize = true,
comment = "companion to lpdf-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/lxml-aux.lua b/tex/context/base/mkiv/lxml-aux.lua
index f93d472ea..126df4d82 100644
--- a/tex/context/base/mkiv/lxml-aux.lua
+++ b/tex/context/base/mkiv/lxml-aux.lua
@@ -566,7 +566,6 @@ local x_stripper = lpegpatterns.x_stripper
local function stripelement(e,nolines,anywhere,everything)
local edt = e.dt
- print(nolines,anywhere,everything)
if edt then
local n = #edt
if n == 0 then
diff --git a/tex/context/base/mkiv/math-map.lua b/tex/context/base/mkiv/math-map.lua
index 2233722a0..97860b923 100644
--- a/tex/context/base/mkiv/math-map.lua
+++ b/tex/context/base/mkiv/math-map.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['math-map'] = {
version = 1.001,
+ optimize = true,
comment = "companion to math-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index 4b009bfa1..188363847 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['math-noa'] = {
version = 1.001,
+ optimize = true,
comment = "companion to math-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/mlib-cnt.lua b/tex/context/base/mkiv/mlib-cnt.lua
index 761eac655..667384ed7 100644
--- a/tex/context/base/mkiv/mlib-cnt.lua
+++ b/tex/context/base/mkiv/mlib-cnt.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['mlib-cnt'] = {
version = 1.001,
+ optimize = true,
comment = "companion to mlib-ctx.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/mlib-svg.lua b/tex/context/base/mkiv/mlib-svg.lua
index 2a1b476ae..4c4122476 100644
--- a/tex/context/base/mkiv/mlib-svg.lua
+++ b/tex/context/base/mkiv/mlib-svg.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['mlib-svg'] = {
version = 1.001,
+ optimize = true,
comment = "companion to mlib-ctx.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index 7ec4e6a54..b0d2bf2fc 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -298,6 +298,7 @@ return {
"quitcondition", "truecondition", "falsecondition",
--
"tracingall", "tracingnone", "loggingall",
+ "showluatokens",
--
"removetoks", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to",
--
diff --git a/tex/context/base/mkiv/node-bck.lua b/tex/context/base/mkiv/node-bck.lua
index 53ace65e9..82c800de8 100644
--- a/tex/context/base/mkiv/node-bck.lua
+++ b/tex/context/base/mkiv/node-bck.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-bck'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-bck.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/node-cmp.lua b/tex/context/base/mkiv/node-cmp.lua
index 18b939999..e9e7e266d 100644
--- a/tex/context/base/mkiv/node-cmp.lua
+++ b/tex/context/base/mkiv/node-cmp.lua
@@ -7,7 +7,7 @@ if not modules then modules = { } end modules ['node-cmp'] = {
}
-- This is a LuaTeX compatibility module. The code below is no longer
--- present node-met or node-aux. These functions are rarely used.
+-- present in node-met or node-aux. These functions are rarely used.
if node.count then
return
diff --git a/tex/context/base/mkiv/node-fin.lua b/tex/context/base/mkiv/node-fin.lua
index a67ec5905..ddcdcd9d0 100644
--- a/tex/context/base/mkiv/node-fin.lua
+++ b/tex/context/base/mkiv/node-fin.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-fin'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-fin.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/node-ini.lua b/tex/context/base/mkiv/node-ini.lua
index 8ebec4a1c..0b048d0e3 100644
--- a/tex/context/base/mkiv/node-ini.lua
+++ b/tex/context/base/mkiv/node-ini.lua
@@ -83,14 +83,22 @@ local fillcodes = mark(getsubtypes("fill"))
local boundarycodes = mark(getsubtypes("boundary"))
local penaltycodes = mark(getsubtypes("penalty"))
local kerncodes = mark(getsubtypes("kern"))
-local margincodes = CONTEXTLMTXMODE == 0 and mark(getsubtypes("marginkern")) or { }
+local margincodes = CONTEXTLMTXMODE > 0 and { }
local mathcodes = mark(getsubtypes("math"))
local noadcodes = mark(getsubtypes("noad"))
local radicalcodes = mark(getsubtypes("radical"))
local accentcodes = mark(getsubtypes("accent"))
local fencecodes = mark(getsubtypes("fence"))
----- fractioncodes = mark(getsubtypes("fraction"))
-local localparcodes = allocate { [0] = "new_graf", "local_box", "hmode_par", "penalty", "math" } -- only in luametatex now
+local localparcodes = CONTEXTLMTXMODE > 0 and mark(getsubtypes("localpar"))
+
+if not margincodes then
+ margincodes = mark(getsubtypes("marginkern"))
+end
+
+if not localparcodes then
+ localparcodes = allocate { [0] = "new_graf", "local_box", "hmode_par", "penalty", "math" }
+end
local function simplified(t)
local r = { }
@@ -104,13 +112,13 @@ local nodecodes = simplified(node.types())
local whatcodes = simplified(node.whatsits and node.whatsits() or { })
local usercodes = allocate {
- [ 97] = "attribute", -- a
- [100] = "number", -- d
- [102] = "float", -- f
- [108] = "lua", -- l
- [110] = "node", -- n
- [115] = "string", -- s
- [116] = "token" -- t
+ [ 97] = "attribute", -- a
+ [100] = "number", -- d
+ [102] = "float", -- f
+ [108] = "lua", -- l
+ [110] = "node", -- n
+ [115] = "string", -- s
+ [116] = "token" -- t
}
local noadoptions = allocate {
@@ -125,24 +133,11 @@ local noadoptions = allocate {
right = 0x14 + 0x08,
}
--- local directionvalues = mark(getvalues("dir"))
--- local gluevalues = mark(getvalues("glue"))
--- local literalvalues = mark(getvalues("literal"))
-
-local dirvalues = allocate {
- [0] = "TLT",
- [1] = "TRT",
- [2] = "LTL",
- [3] = "RTT",
-}
+local dirvalues = CONTEXTLMTXMODE > 0 and mark(getvalues("dir"))
-local gluevalues = allocate {
- [0] = "normal",
- [1] = "fi",
- [2] = "fil",
- [3] = "fill",
- [4] = "filll",
-}
+if not dirvalues then
+ dirvalues = allocate { [0] = "lefttoright", [1] = "righttoleft" }
+end
local literalvalues = allocate {
[0] = "origin",
@@ -154,6 +149,8 @@ local literalvalues = allocate {
[6] = "special",
}
+local gluevalues = mark(getvalues("glue"))
+
gluecodes = allocate(swapped(gluecodes,gluecodes))
dircodes = allocate(swapped(dircodes,dircodes))
boundarycodes = allocate(swapped(boundarycodes,boundarycodes))
@@ -232,9 +229,6 @@ nodes.dirvalues = dirvalues
nodes.gluevalues = gluevalues
nodes.literalvalues = literalvalues
-dirvalues.lefttoright = 0
-dirvalues.righttoleft = 1
-
nodes.subtypes = allocate {
[nodecodes.accent] = accentcodes,
[nodecodes.boundary] = boundarycodes,
@@ -267,14 +261,16 @@ table.setmetatableindex(nodes.subtypes,function(t,k)
return v
end)
-nodes.skipcodes = gluecodes -- more friendly
-nodes.directioncodes = dircodes -- more friendly
-nodes.whatsitcodes = whatcodes -- more official
+-- a few more friendly aliases:
+
+nodes.skipcodes = gluecodes
+nodes.directioncodes = dircodes
+nodes.whatsitcodes = whatcodes
nodes.marginkerncodes = margincodes
nodes.discretionarycodes = disccodes
-nodes.directionvalues = dirvalues -- more friendly
-nodes.skipvalues = gluevalues -- more friendly
-nodes.literalvalues = literalvalues -- more friendly
+nodes.directionvalues = dirvalues
+nodes.skipvalues = gluevalues
+nodes.literalvalues = literalvalues
glyphcodes.glyph = glyphcodes.character
diff --git a/tex/context/base/mkiv/node-ltp.lua b/tex/context/base/mkiv/node-ltp.lua
index a85bdfe01..709ef2b95 100644
--- a/tex/context/base/mkiv/node-ltp.lua
+++ b/tex/context/base/mkiv/node-ltp.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-par'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-par.mkiv",
author = "Hans Hagen",
copyright = "ConTeXt Development Team",
@@ -259,7 +260,6 @@ local nodepool = nuts.pool
local nodecodes = nodes.nodecodes
local kerncodes = nodes.kerncodes
-local margincodes = nodes.margincodes
local disccodes = nodes.disccodes
local mathcodes = nodes.mathcodes
local fillcodes = nodes.fillcodes
@@ -294,9 +294,6 @@ local italickern_code = kerncodes.italiccorrection
local fontkern_code = kerncodes.fontkern
local accentkern_code = kerncodes.accentkern
-local leftmargin_code = margincodes.left
------ rightmargin_code = margincodes.right
-
local automaticdisc_code = disccodes.automatic
local regulardisc_code = disccodes.regular
local firstdisc_code = disccodes.first
diff --git a/tex/context/base/mkiv/node-ref.lua b/tex/context/base/mkiv/node-ref.lua
index ac43a84a3..2e035b2e0 100644
--- a/tex/context/base/mkiv/node-ref.lua
+++ b/tex/context/base/mkiv/node-ref.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-ref'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-ref.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/node-rul.lua b/tex/context/base/mkiv/node-rul.lua
index b904e54d6..830d97ff6 100644
--- a/tex/context/base/mkiv/node-rul.lua
+++ b/tex/context/base/mkiv/node-rul.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-rul'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-rul.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/node-shp.lua b/tex/context/base/mkiv/node-shp.lua
index 7af789b1b..58dc94495 100644
--- a/tex/context/base/mkiv/node-shp.lua
+++ b/tex/context/base/mkiv/node-shp.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['node-shp'] = {
version = 1.001,
+ optimize = true,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/pack-rul.lua b/tex/context/base/mkiv/pack-rul.lua
index 5c3c10348..8e410f0cf 100644
--- a/tex/context/base/mkiv/pack-rul.lua
+++ b/tex/context/base/mkiv/pack-rul.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['pack-rul'] = {
version = 1.001,
+ optimize = true,
comment = "companion to pack-rul.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/spac-ali.lua b/tex/context/base/mkiv/spac-ali.lua
index c30a4fa94..7a09ba5aa 100644
--- a/tex/context/base/mkiv/spac-ali.lua
+++ b/tex/context/base/mkiv/spac-ali.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['spac-ali'] = {
version = 1.001,
+ optimize = true,
comment = "companion to spac-ali.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/spac-chr.lua b/tex/context/base/mkiv/spac-chr.lua
index 9b8453ca6..087bff89a 100644
--- a/tex/context/base/mkiv/spac-chr.lua
+++ b/tex/context/base/mkiv/spac-chr.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['spac-chr'] = {
version = 1.001,
+ optimize = true,
comment = "companion to spac-chr.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/spac-ver.lua b/tex/context/base/mkiv/spac-ver.lua
index 33b81e5c7..b2d5a3e2d 100644
--- a/tex/context/base/mkiv/spac-ver.lua
+++ b/tex/context/base/mkiv/spac-ver.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['spac-ver'] = {
version = 1.001,
+ optimize = true,
comment = "companion to spac-ver.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index d2faf2ac3..e1d84cd54 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 81adece53..1a650ecbf 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/supp-box.lua b/tex/context/base/mkiv/supp-box.lua
index a39bf392f..2dcbbb692 100644
--- a/tex/context/base/mkiv/supp-box.lua
+++ b/tex/context/base/mkiv/supp-box.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['supp-box'] = {
version = 1.001,
+ optimize = true,
comment = "companion to supp-box.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv
index 1fa52e625..acfcf7320 100644
--- a/tex/context/base/mkiv/syst-ini.mkiv
+++ b/tex/context/base/mkiv/syst-ini.mkiv
@@ -1190,5 +1190,4 @@
\def\tokenized#1{\scantextokens\expandafter{\normalexpanded{#1}}}
\fi
-
\protect \endinput
diff --git a/tex/context/base/mkiv/syst-lua.lua b/tex/context/base/mkiv/syst-lua.lua
index 5976e077f..7e44b9f08 100644
--- a/tex/context/base/mkiv/syst-lua.lua
+++ b/tex/context/base/mkiv/syst-lua.lua
@@ -171,7 +171,9 @@ local xcomplex = xcomplex or { }
local cmd = tokens.commands
-local get_next = token.get_next
+local scan_next = token.scan_next or token.get_next
+local scan_cmdchr = token.scan_cmdchr_expanded
+
local get_command = token.get_command
local get_mode = token.get_mode
local get_index = token.get_index
@@ -210,7 +212,7 @@ if CONTEXTLMTXMODE == 0 then
local w = 0
local r = 1
while true do
- local t = get_next()
+ local t = scan_next()
local n = get_command(t)
local c = cmd[n]
-- todo, helper: returns number
@@ -292,8 +294,6 @@ if CONTEXTLMTXMODE == 0 then
else
- local get_cmdchrcs = tokens.get_cmdchrcs or token.get_cmdchrcs
-
local letter_code = cmd.letter
local other_char_code = cmd.other_char
local spacer_code = cmd.spacer
@@ -311,10 +311,10 @@ else
local math_given_code = cmd.math_given
local xmath_given_code = cmd.xmath_given
local some_item_code = cmd.some_item
- local call_code = cmd.call
- local the_code = cmd.the
- local convert_code = cmd.convert
- local lua_expandable_call_code = cmd.lua_expandable_call
+ -- local call_code = cmd.call
+ -- local the_code = cmd.the
+ -- local convert_code = cmd.convert
+ -- local lua_expandable_call_code = cmd.lua_expandable_call
local function unexpected(c)
report("unexpected token %a",c)
@@ -324,8 +324,7 @@ else
local w = 0
local r = 1
while true do
- local t = get_next()
- local n, i = get_cmdchrcs(t)
+ local n, i = scan_cmdchr()
if n == letter_code then
w = w + 1 ; word[w] = utfchar(i)
else
@@ -374,21 +373,21 @@ else
else
unexpected(c)
end
- elseif n == call_code then
- local n = get_csname(t)
- if n then
- local s = get_macro(n)
- if s then
- r = r + 1 ; result[r] = s
- else
- unexpected(c)
- end
- else
- unexpected(c)
- end
- elseif n == the_code or n == convert_code or n == lua_expandable_call_code then
- put_next(t)
- scan_token() -- expands
+ -- elseif n == call_code then
+ -- local n = get_csname(t)
+ -- if n then
+ -- local s = get_macro(n)
+ -- if s then
+ -- r = r + 1 ; result[r] = s
+ -- else
+ -- unexpected(c)
+ -- end
+ -- else
+ -- unexpected(c)
+ -- end
+ -- elseif n == the_code or n == convert_code or n == lua_expandable_call_code then
+ -- put_next(t)
+ -- scan_token() -- expands
else
unexpected(c)
end
diff --git a/tex/context/base/mkiv/tabl-tbl.mkiv b/tex/context/base/mkiv/tabl-tbl.mkiv
index 9fea15e83..ce8d67b63 100644
--- a/tex/context/base/mkiv/tabl-tbl.mkiv
+++ b/tex/context/base/mkiv/tabl-tbl.mkiv
@@ -2264,7 +2264,7 @@
\s_tabl_tabulate_first.5\d_tabl_tabulate_unit
\s_tabl_tabulate_last\s_tabl_tabulate_first
\s_tabl_tabulate_pre\zeropoint
- \s_tabl_tabulate_post\s_tabl_tabulate_first % was: \zeropoint
+ \s_tabl_tabulate_post\zeropoint
\global\c_tabl_tabulate_columns\zerocount
\global\c_tabl_tabulate_nofauto\zerocount
\global\c_tabl_tabulate_noflines\zerocount
diff --git a/tex/context/base/mkiv/tabl-tbl.mkxl b/tex/context/base/mkiv/tabl-tbl.mkxl
index 8e4e45b9c..8bed65a9f 100644
--- a/tex/context/base/mkiv/tabl-tbl.mkxl
+++ b/tex/context/base/mkiv/tabl-tbl.mkxl
@@ -2259,6 +2259,15 @@
{\setlocalhsize
\hsize\localhsize}
+% test case for pre/post spacing:
+%
+% \ruledvbox{\starttabulate[|l|] \FL\NC xxx \NC \NR\LL\stoptabulate}
+% \ruledvbox{\starttabulate[|l|l|]\FL\NC xxx \NC xxx \NC \NR\LL\stoptabulate}
+% \ruledvbox{\starttabulate[|l|] \NC xxx \NC \NR \stoptabulate}
+% \ruledvbox{\starttabulate[|lj8|] \NC xxx \NC \NR \stoptabulate}
+% \ruledvbox{\starttabulate[|k8|] \NC xxx \NC \NR \stoptabulate}
+% \ruledvbox{\starttabulate[|l|l|] \NC xxx \NC xxx \NC \NR \stoptabulate}
+
\def\tabl_tabulate_process
{\c_tabl_tabulate_pass\plusone
\tabl_tabulate_check_full_content
@@ -2266,7 +2275,7 @@
\s_tabl_tabulate_first.5\d_tabl_tabulate_unit
\s_tabl_tabulate_last\s_tabl_tabulate_first
\s_tabl_tabulate_pre\zeropoint
- \s_tabl_tabulate_post\s_tabl_tabulate_first % was: \zeropoint
+ \s_tabl_tabulate_post\zeropoint
\global\c_tabl_tabulate_columns\zerocount
\global\c_tabl_tabulate_nofauto\zerocount
\global\c_tabl_tabulate_noflines\zerocount
diff --git a/tex/context/base/mkiv/tabl-xtb.lua b/tex/context/base/mkiv/tabl-xtb.lua
index 2ff87e21a..c9dd1e4e5 100644
--- a/tex/context/base/mkiv/tabl-xtb.lua
+++ b/tex/context/base/mkiv/tabl-xtb.lua
@@ -900,7 +900,7 @@ function xtables.construct()
end
nofr = nofr + 1
local rp = rowproperties[r]
- -- we have a direction issue here but hpack_node_list(list,0,"exactly","TLT") cannot be used
+ -- we have a direction issue here but hpack_node_list(list,0,"exactly") cannot be used
-- due to the fact that we need the width
local hbox = hpack_node_list(list)
setdirection(hbox,lefttoright_code)
diff --git a/tex/context/base/mkiv/toks-aux.lua b/tex/context/base/mkiv/toks-aux.lua
new file mode 100644
index 000000000..1cfc13af3
--- /dev/null
+++ b/tex/context/base/mkiv/toks-aux.lua
@@ -0,0 +1,88 @@
+if not modules then modules = { } end modules ['toks-aux'] = {
+ version = 1.001,
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+if CONTEXTLMTXMODE > 0 then
+
+ local type, tostring = type, tostring
+ local max = math.max
+ local formatters, gsub = string.formatters, string.gsub
+
+ interfaces.implement {
+ name = "showluatokens",
+ public = true,
+ protected = true,
+ actions = function()
+ local f0 = formatters["%s: %s"]
+ local nl = logs.newline
+ local wr = logs.writer
+ local t = token.peek_next() -- local t = token.scan_next() token.put_back(t)
+ local n = ""
+ local w = ""
+ local c = t.cmdname
+ if c == "left_brace" then
+ w = "given token list"
+ t = token.scan_toks(false)
+ elseif c == "register_toks" then
+ token.scan_next()
+ w = "token register"
+ n = t.csname or t.index
+ t = tex.gettoks(n,true)
+ elseif c == "internal_toks" then
+ token.scan_next()
+ w = "internal token variable"
+ n = t.csname or t.index
+ t = tex.gettoks(n,true)
+ else
+ if t.protected then
+ w = "protected control sequence"
+ else
+ w = "control sequence"
+ end
+ n = token.scan_csname()
+ t = token.get_meaning(n,true)
+ end
+ wr(f0(w,n))
+ nl()
+ if type(t) == "table" then
+ local w1 = 4
+ local w2 = 1
+ local w3 = 3
+ local w4 = 3
+ for i=1,#t do
+ local ti = t[i]
+ w1 = max(w1,#tostring(ti.id))
+ w2 = max(w2,#tostring(ti.command))
+ w3 = max(w3,#tostring(ti.index))
+ w4 = max(w4,#ti.cmdname)
+ end
+ local f1 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s %s"]
+ local f2 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s"]
+ local f3 = formatters["%" .. w1 .. "i %" .. w2 .. "i %" .. w3 .. "i %-" .. w4 .. "s %C"]
+ for i=1,#t do
+ local ti = t[i]
+ local cs = ti.csname
+ local id = ti.id
+ local ix = ti.index
+ local cd = ti.command
+ local cn = gsub(ti.cmdname,"_"," ")
+ if cs then
+ wr(f1(id,cd,ix,cn,cs))
+ elseif cn == "letter" or cn == "other_char" then
+ wr(f3(id,cd,ix,cn,ix))
+ else
+ wr(f2(id,cd,ix,cn))
+ if cn == "end_match" then
+ wr("-------")
+ end
+ end
+ end
+ nl()
+ end
+ end
+ }
+
+end
diff --git a/tex/context/base/mkiv/toks-aux.mkiv b/tex/context/base/mkiv/toks-aux.mkiv
index 5b43de596..413b1f7c8 100644
--- a/tex/context/base/mkiv/toks-aux.mkiv
+++ b/tex/context/base/mkiv/toks-aux.mkiv
@@ -15,6 +15,21 @@
\unprotect
+% The older \type {\scantokens} overload has been replace by a more modern
+% one (in \LMTX):
+%
+% \protected\def\whatever#1[#2](#3)\relax{oeps #1 and #2 and #3 done ## error}
+% \scratchtoks{foo \framed{\red 123}456}
+%
+% \showluatokens{123\what}
+% \showluatokens\whatever
+% \showluatokens\framed
+%
+% \showluatokens\scratchtoks
+% \showluatokens\everypar
+
+\registerctxluafile{toks-aux}{}
+
\installcorenamespace {tokenlist}
\unexpanded\def\definetokenlist[#1]%
diff --git a/tex/context/base/mkiv/toks-ini.lua b/tex/context/base/mkiv/toks-ini.lua
index e0c093492..65a7645f4 100644
--- a/tex/context/base/mkiv/toks-ini.lua
+++ b/tex/context/base/mkiv/toks-ini.lua
@@ -68,16 +68,7 @@ local scan_luanumber = token.scan_luanumber or scan_float -- only lmtx
local scan_luainteger = token.scan_luainteger or scan_int -- only lmtx
local scan_luacardinal = token.scan_luacardinal or scan_int -- only lmtx
-local get_next = token.get_next
------ get_next_token = token.get_next_token
-local skip_next = token.skip_next
-local peek_next_char = token.peek_next_char
-local is_next_char = token.is_next_char
-
local set_macro = token.set_macro
-local get_macro = token.get_macro
-local get_meaning = token.get_meaning
-local get_cmdname = token.get_cmdname
local set_char = token.set_char
local set_lua = token.set_lua
@@ -173,50 +164,63 @@ if not scan_box then
end
tokens.scanners = { -- these expand
- token = scan_token,
- toks = scan_toks,
- tokens = scan_toks,
- box = scan_box,
- hbox = function() return scan_box("hbox") end,
- vbox = function() return scan_box("vbox") end,
- vtop = function() return scan_box("vtop") end,
- dimen = scan_dimen,
- dimension = scan_dimen,
- glue = scan_glue,
- gluespec = scan_gluespec,
- integer = scan_int,
- real = scan_real,
- float = scan_float,
- luanumber = scan_luanumber,
- luainteger = scan_luainteger,
- luacardinal = scan_luacardinal,
- count = scan_int,
- string = scan_string,
- argument = scan_argument,
- delimited = scan_delimited,
- tokenlist = scan_tokenlist,
- verbatim = scan_verbatim, -- detokenize
- code = scan_code,
- tokencode = scan_token_code,
- word = scan_word,
- letters = scan_letters,
- key = scan_key,
- value = scan_value,
- char = scan_char,
- number = scan_number,
- boolean = scan_boolean,
- keyword = scan_keyword,
- keywordcs = scan_keyword_cs,
- csname = scan_csname,
- peek = peek_next_char,
- skip = skip_next,
- ischar = is_next_char,
+ token = scan_token,
+ toks = scan_toks,
+ tokens = scan_toks,
+ box = scan_box,
+ hbox = function() return scan_box("hbox") end,
+ vbox = function() return scan_box("vbox") end,
+ vtop = function() return scan_box("vtop") end,
+ dimen = scan_dimen,
+ dimension = scan_dimen,
+ glue = scan_glue,
+ gluespec = scan_gluespec,
+ integer = scan_int,
+ real = scan_real,
+ float = scan_float,
+ luanumber = scan_luanumber,
+ luainteger = scan_luainteger,
+ luacardinal = scan_luacardinal,
+ count = scan_int,
+ string = scan_string,
+ argument = scan_argument,
+ delimited = scan_delimited,
+ tokenlist = scan_tokenlist,
+ verbatim = scan_verbatim, -- detokenize
+ code = scan_code,
+ tokencode = scan_token_code,
+ word = scan_word,
+ letters = scan_letters,
+ key = scan_key,
+ value = scan_value,
+ char = scan_char,
+ number = scan_number,
+ boolean = scan_boolean,
+ keyword = scan_keyword,
+ keywordcs = scan_keyword_cs,
+ csname = scan_csname,
+
+ next = token.scan_next,
+ nextexpanded = token.scan_next_expanded,
+
+ peek = token.peek_next,
+ peekexpanded = token.peek_next_expanded,
+ peekchar = token.peek_next_char,
+
+ skip = token.skip_next,
+ skipexpanded = token.skip_next_expanded,
+
+ cmdchr = token.scan_cmdchr,
+ cmdchrexpanded = token.scan_cmdchr_expanded,
+
+ ischar = token.is_next_char,
}
tokens.getters = { -- these don't expand
- meaning = get_meaning,
- macro = get_macro,
- token = get_next,
+ meaning = token.get_meaning,
+ macro = token.get_macro,
+ token = token.scan_next, -- not here, use scanners.next or token
+ cstoken = token.get_cstoken,
count = tex.getcount,
dimen = tex.getdimen,
skip = tex.getglue,
@@ -239,6 +243,23 @@ tokens.setters = {
box = tex.setbox,
}
+token.accessors = {
+ command = token.get_command,
+ cmd = token.get_command,
+ cmdname = token.get_cmdname,
+ name = token.get_cmdname,
+ csname = token.get_csname,
+ index = token.get_index,
+ active = token.get_active,
+ frozen = token.get_frozen,
+ protected = token.get_protected,
+ expandable = token.get_protected,
+ user = token.get_user,
+ cmdchrcs = token.get_cmdchrcs,
+ active = token.get_active,
+ range = token.get_range,
+}
+
-- static int run_scan_token(lua_State * L)
-- {
-- saved_tex_scanner texstate;
diff --git a/tex/context/base/mkiv/toks-tra.lua b/tex/context/base/mkiv/toks-tra.lua
deleted file mode 100644
index 3a5bc1306..000000000
--- a/tex/context/base/mkiv/toks-tra.lua
+++ /dev/null
@@ -1,293 +0,0 @@
-if not modules then modules = { } end modules ['toks-ini'] = {
- version = 1.001,
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- this will become a module
-
-local utfbyte, utfchar, utfvalues = utf.byte, utf.char, utf.values
-local format, gsub = string.format, string.gsub
-local tostring = tostring
-
-local tokens = tokens
-local token = token -- the built in one
-local tex = tex
-local context = context
-local commands = commands
-
-tokens.collectors = tokens.collectors or { }
-local collectors = tokens.collectors
-
-collectors.data = collectors.data or { }
-local collectordata = collectors.data
-
-collectors.registered = collectors.registered or { }
-local registered = collectors.registered
-
-local report = logs.reporter("tokens","collectors")
-
--- todo:
---
--- register : macros that will be expanded (only for demo-ing)
--- flush : print back to tex
--- test : fancy stuff
-
-local get_next = token.get_next
-local create_token = token.create
-
-function collectors.install(tag,end_cs)
- local data, d = { }, 0
- collectordata[tag] = data
- end_cs = gsub(end_cs,"^\\","")
- while true do
- local t = get_next()
- if t.csname == end_cs then
- context[end_cs]()
- return
- else
- d = d + 1
- data[d] = t
- end
- end
-end
-
-local simple = { letter = "letter", other_char = "other" }
-
-function collectors.show(data)
- -- We no longer have methods as we only used (in demos) method a
- -- so there is no need to burden the core with this. We have a
- -- different table anyway.
- if type(data) == "string" then
- data = collectordata[data]
- end
- if not data then
- return
- end
- local ctx_NC = context.NC
- local ctx_NR = context.NR
- local ctx_bold = context.bold
- local ctx_verbatim = context.verbatim
- context.starttabulate { "|Tl|Tc|Tl|" }
- ctx_NC() ctx_bold("cmd")
- ctx_NC() ctx_bold("meaning")
- ctx_NC() ctx_bold("properties")
- ctx_NC() ctx_NR()
- context.HL()
- for i=1,#data do
- local token = data[i]
- local cmdname = token.cmdname
- local simple = simple[cmdname]
- ctx_NC()
- ctx_verbatim(simple or cmdname)
- ctx_NC()
- ctx_verbatim(simple and utfchar(token.mode) or token.csname)
- ctx_NC()
- if token.active then context("active ") end
- if token.expandable then context("expandable ") end
- if token.protected then context("protected ") end
- ctx_NC()
- ctx_NR()
- end
- context.stoptabulate()
-end
-
-local function printlist(data)
- if data and #data > 0 then
- report("not supported (yet): printing back to tex")
- end
-end
-
-tokens.printlist = printlist -- will change to another namespace
-
-function collectors.flush(tag)
- printlist(collectordata[tag])
-end
-
-function collectors.test(tag,handle)
- report("not supported (yet): testing")
-end
-
-function collectors.register(name)
- report("not supported (yet): registering")
-end
-
--- -- old token code
---
--- -- 1 = command, 2 = modifier (char), 3 = controlsequence id
---
--- local create = token.create
--- local csname_id = token.csname_id
--- local command_id = token.command_id
--- local command_name = token.command_name
--- local get_next = token.get_next
--- local expand = token.expand
--- local csname_name = token.csname_name
---
--- local function printlist(data)
--- if data and #data > 0 then
--- callbacks.push('token_filter', function ()
--- callbacks.pop('token_filter') -- tricky but the nil assignment helps
--- return data
--- end)
--- end
--- end
---
--- tokens.printlist = printlist -- will change to another namespace
---
--- function collectors.flush(tag)
--- printlist(collectordata[tag])
--- end
---
--- function collectors.register(name)
--- registered[csname_id(name)] = name
--- end
---
--- local call = command_id("call")
--- local letter = command_id("letter")
--- local other = command_id("other_char")
---
--- function collectors.install(tag,end_cs)
--- local data, d = { }, 0
--- collectordata[tag] = data
--- end_cs = gsub(end_cs,"^\\","")
--- local endcs = csname_id(end_cs)
--- while true do
--- local t = get_next()
--- local a, b = t[1], t[3]
--- if b == endcs then
--- context[end_cs]()
--- return
--- elseif a == call and registered[b] then
--- expand()
--- else
--- d = d + 1
--- data[d] = t
--- end
--- end
--- end
---
--- function collectors.show(data)
--- -- We no longer have methods as we only used (in demos) method a
--- -- so there is no need to burden the core with this.
--- if type(data) == "string" then
--- data = collectordata[data]
--- end
--- if not data then
--- return
--- end
--- local ctx_NC = context.NC
--- local ctx_NR = context.NR
--- local ctx_bold = context.bold
--- local ctx_verbatim = context.verbatim
--- context.starttabulate { "|T|Tr|cT|Tr|T|" }
--- ctx_NC() ctx_bold("cmd")
--- ctx_NC() ctx_bold("chr")
--- ctx_NC()
--- ctx_NC() ctx_bold("id")
--- ctx_NC() ctx_bold("name")
--- ctx_NC() ctx_NR()
--- context.HL()
--- for i=1,#data do
--- local token = data[i]
--- local cmd = token[1]
--- local chr = token[2]
--- local id = token[3]
--- local name = command_name(token)
--- ctx_NC()
--- ctx_verbatim(name)
--- ctx_NC()
--- if tonumber(chr) >= 0 then
--- ctx_verbatim(chr)
--- end
--- ctx_NC()
--- if cmd == letter or cmd == other then
--- ctx_verbatim(utfchar(chr))
--- end
--- ctx_NC()
--- if id > 0 then
--- ctx_verbatim(id)
--- end
--- ctx_NC()
--- if id > 0 then
--- ctx_verbatim(csname_name(token) or "")
--- end
--- ctx_NC() ctx_NR()
--- end
--- context.stoptabulate()
--- end
---
--- function collectors.test(tag,handle)
--- local t, w, tn, wn = { }, { }, 0, 0
--- handle = handle or collectors.defaultwords
--- local tagdata = collectordata[tag]
--- for k=1,#tagdata do
--- local v = tagdata[k]
--- if v[1] == letter then
--- wn = wn + 1
--- w[wn] = v[2]
--- else
--- if wn > 0 then
--- handle(t,w)
--- wn = 0
--- end
--- tn = tn + 1
--- t[tn] = v
--- end
--- end
--- if wn > 0 then
--- handle(t,w)
--- end
--- collectordata[tag] = t
--- end
-
--- Interfacing:
-
-commands.collecttokens = collectors.install
-commands.showtokens = collectors.show
-commands.flushtokens = collectors.flush
-commands.testtokens = collectors.test
-commands.registertoken = collectors.register
-
--- Redundant:
-
--- function collectors.test(tag)
--- printlist(collectordata[tag])
--- end
-
--- For old times sake:
-
-collectors.dowithwords = collectors.test
-
--- This is only used in old articles ... will move to a module:
-
-tokens.vbox = create_token("vbox")
-tokens.hbox = create_token("hbox")
-tokens.vtop = create_token("vtop")
-tokens.bgroup = create_token(utfbyte("{"),1)
-tokens.egroup = create_token(utfbyte("}"),2)
-
-tokens.letter = function(chr) return create_token(utfbyte(chr),11) end
-tokens.other = function(chr) return create_token(utfbyte(chr),12) end
-
-tokens.letters = function(str)
- local t, n = { }, 0
- for chr in utfvalues(str) do
- n = n + 1
- t[n] = create_token(chr, 11)
- end
- return t
-end
-
-function collectors.defaultwords(t,str)
- if t then
- local n = #t
- n = n + 1 ; t[n] = tokens.bgroup
- n = n + 1 ; t[n] = create_token("red")
- for i=1,#str do
- n = n + 1 ; t[n] = tokens.other('*')
- end
- n = n + 1 ; t[n] = tokens.egroup
- end
-end
diff --git a/tex/context/base/mkiv/toks-tra.mkiv b/tex/context/base/mkiv/toks-tra.mkiv
deleted file mode 100644
index 04f837f1c..000000000
--- a/tex/context/base/mkiv/toks-tra.mkiv
+++ /dev/null
@@ -1,34 +0,0 @@
-%D \module
-%D [ file=toks-tra, % was toks-ini
-%D version=2007.03.03,
-%D title=\CONTEXT\ Token Support,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Token Support / Tracing}
-
-\registerctxluafile{toks-tra}{}
-
-\unprotect
-
-%D Handy for manuals \unknown\ but not really used in practice, so it might
-%D become a runtime loaded module instead.
-
-\unexpanded\def\starttokens [#1]{\ctxcommand{collecttokens("#1","stoptokens")}}
- \let\stoptokens \relax
-\unexpanded\def\flushtokens [#1]{\ctxcommand{flushtokens("#1")}}
-\unexpanded\def\showtokens [#1]{\ctxcommand{showtokens("#1")}}
-\unexpanded\def\testtokens [#1]{\ctxcommand{testtokens("#1")}}
-\unexpanded\def\registertoken #1{\ctxcommand{registertoken("#1")}}
-
-\let\toks_show\showtokens % we also support the primitive
-
-\unexpanded\def\showtokens{\doifelsenextoptional\toks_show\normalshowtokens}
-
-\protect \endinput
diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua
index f89043547..2d2fd4092 100644
--- a/tex/context/base/mkiv/trac-vis.lua
+++ b/tex/context/base/mkiv/trac-vis.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['trac-vis'] = {
version = 1.001,
+ optimize = true,
comment = "companion to trac-vis.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/typo-cap.lua b/tex/context/base/mkiv/typo-cap.lua
index c1666a9f1..3d0d6055a 100644
--- a/tex/context/base/mkiv/typo-cap.lua
+++ b/tex/context/base/mkiv/typo-cap.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['typo-cap'] = {
version = 1.001,
+ optimize = true,
comment = "companion to typo-cap.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/typo-dha.lua b/tex/context/base/mkiv/typo-dha.lua
index 7d5c7751b..7be74caa1 100644
--- a/tex/context/base/mkiv/typo-dha.lua
+++ b/tex/context/base/mkiv/typo-dha.lua
@@ -14,12 +14,12 @@ if not modules then modules = { } end modules ['typo-dha'] = {
--
-- Then we have, with input: LATIN ARAB
--
--- \textdir TLT LATIN ARAB => LATIN BARA
--- \textdir TRT LATIN ARAB => LATIN BARA
--- \textdir TRT LRO LATIN ARAB => LATIN ARAB
--- \textdir TLT LRO LATIN ARAB => LATIN ARAB
--- \textdir TLT RLO LATIN ARAB => NITAL ARAB
--- \textdir TRT RLO LATIN ARAB => NITAL ARAB
+-- \textdirection 1 LATIN ARAB => LATIN BARA
+-- \textdirection 1 LATIN ARAB => LATIN BARA
+-- \textdirection 1 LRO LATIN ARAB => LATIN ARAB
+-- \textdirection 1 LRO LATIN ARAB => LATIN ARAB
+-- \textdirection 1 RLO LATIN ARAB => NITAL ARAB
+-- \textdirection 1 RLO LATIN ARAB => NITAL ARAB
-- elseif d == "es" then -- European Number Separator
-- elseif d == "et" then -- European Number Terminator
@@ -272,12 +272,12 @@ local function process(start)
stack[top] = { override, embedded }
override = 1
obsolete[#obsolete+1] = current
- elseif direction == "lre" then -- Left-to-Right Embedding -> TLT
+ elseif direction == "lre" then -- Left-to-Right Embedding -> lefttoright_code
top = top + 1
stack[top] = { override, embedded }
embedded = 1
obsolete[#obsolete+1] = current
- elseif direction == "rle" then -- Right-to-Left Embedding -> TRT
+ elseif direction == "rle" then -- Right-to-Left Embedding -> righttoleft_code
top = top + 1
stack[top] = { override, embedded }
embedded = -1
@@ -382,7 +382,7 @@ local function process(start)
if cp == "n" then
local swap = state == "r"
if swap then
- head = insert_node_before(head,current,startdir("TLT"))
+ head = insert_node_before(head,current,startdir(lefttoright_code))
end
setprop(current,"direction",true)
while true do
@@ -395,14 +395,14 @@ local function process(start)
end
end
if swap then
- head, current = insert_node_after(head,current,stopdir("TLT"))
+ head, current = insert_node_after(head,current,stopdir(lefttoright_code))
end
elseif cp == "l" then
if state ~= "l" then
if state == "r" then
- head = insert_node_before(head,last or current,stopdir("TRT"))
+ head = insert_node_before(head,last or current,stopdir(righttoleft_code))
end
- head = insert_node_before(head,current,startdir("TLT"))
+ head = insert_node_before(head,current,startdir(lefttoright_code))
state = "l"
done = true
end
@@ -410,9 +410,9 @@ local function process(start)
elseif cp == "r" then
if state ~= "r" then
if state == "l" then
- head = insert_node_before(head,last or current,stopdir("TLT"))
+ head = insert_node_before(head,last or current,stopdir(lefttoright_code))
end
- head = insert_node_before(head,current,startdir("TRT"))
+ head = insert_node_before(head,current,startdir(righttoleft_code))
state = "r"
done = true
end
@@ -425,9 +425,9 @@ local function process(start)
end
else
if state == "r" then
- head = insert_node_before(head,current,stopdir("TRT"))
+ head = insert_node_before(head,current,stopdir(righttoleft_code))
elseif state == "l" then
- head = insert_node_before(head,current,stopdir("TLT"))
+ head = insert_node_before(head,current,stopdir(lefttoright_code))
end
state = false
last = false
@@ -438,7 +438,7 @@ local function process(start)
if next then
current = next
else
- local sd = (state == "r" and stopdir("TRT")) or (state == "l" and stopdir("TLT"))
+ local sd = (state == "r" and stopdir(righttoleft_code)) or (state == "l" and stopdir(lefttoright_code))
if sd then
if id == glue_code and getsubtype(current) == parfillskip_code then
head = insert_node_before(head,current,sd)
diff --git a/tex/context/base/mkiv/typo-dig.lua b/tex/context/base/mkiv/typo-dig.lua
index 175fc0cc7..a9294a38d 100644
--- a/tex/context/base/mkiv/typo-dig.lua
+++ b/tex/context/base/mkiv/typo-dig.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['typo-dig'] = {
version = 1.001,
+ optimize = true,
comment = "companion to typo-dig.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/typo-dua.lua b/tex/context/base/mkiv/typo-dua.lua
index 0cec0e08e..92cca7ae4 100644
--- a/tex/context/base/mkiv/typo-dua.lua
+++ b/tex/context/base/mkiv/typo-dua.lua
@@ -343,12 +343,6 @@ local function get_baselevel(head,list,size,direction)
return direction, true
end
end
- -- for old times sake we we handle strings too
- if direction == "TLT" then
- return lefttoright_code, true
- elseif direction == "TRT" then
- return righttoleft_code, true
- end
-- P2, P3
for i=1,size do
local entry = list[i]
diff --git a/tex/context/base/mkiv/typo-dub.lua b/tex/context/base/mkiv/typo-dub.lua
index f1bd38fcc..ccbcc0a06 100644
--- a/tex/context/base/mkiv/typo-dub.lua
+++ b/tex/context/base/mkiv/typo-dub.lua
@@ -404,12 +404,6 @@ local function get_baselevel(head,list,size,direction)
return direction, true
end
end
- -- for old times sake we we handle strings too
- if direction == "TLT" then
- return lefttoright_code, true
- elseif direction == "TRT" then
- return righttoleft_code, true
- end
-- P2, P3
for i=1,size do
local entry = list[i]
diff --git a/tex/context/base/mkiv/typo-duc.lua b/tex/context/base/mkiv/typo-duc.lua
index d4c56e300..a1ee14a28 100644
--- a/tex/context/base/mkiv/typo-duc.lua
+++ b/tex/context/base/mkiv/typo-duc.lua
@@ -419,12 +419,6 @@ local function get_baselevel(head,list,size,direction)
return direction, true
end
end
- -- for old times sake we we handle strings too
- if direction == "TLT" then
- return lefttoright_code, true
- elseif direction == "TRT" then
- return righttoleft_code, true
- end
-- P2, P3
for i=1,size do
local entry = list[i]
diff --git a/tex/context/base/mkiv/util-fil.lua b/tex/context/base/mkiv/util-fil.lua
index 79af27743..183f7bea8 100644
--- a/tex/context/base/mkiv/util-fil.lua
+++ b/tex/context/base/mkiv/util-fil.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['util-fil'] = {
version = 1.001,
+ optimize = true,
comment = "companion to luat-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
diff --git a/tex/context/base/mkiv/util-sac.lua b/tex/context/base/mkiv/util-sac.lua
index 47c753ab1..a8851f4c8 100644
--- a/tex/context/base/mkiv/util-sac.lua
+++ b/tex/context/base/mkiv/util-sac.lua
@@ -1,5 +1,6 @@
if not modules then modules = { } end modules ['util-sac'] = {
version = 1.001,
+ optimize = true,
comment = "companion to luat-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",