Add table of primitive tokens.

(Might become private later)
This commit is contained in:
Marcel Krüger 2020-07-19 02:13:48 +02:00
parent 68c8057093
commit c405d076b6
1 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,17 @@ pdf = {
require'luametalatex-font-resolve' -- Replace font.define. Must be loaded before callbacks
require'luametalatex-basecallbacks'
local primitives = {}
do
local token_primitives = token.primitives()
local token_new = token.new
for i=1,#token_primitives do
local prim = token_primitives[i]
primitives[prim[3]] = token_new(prim[2], prim[1])
end
end
token.primitive_tokens = primitives
local functions = lua.getfunctionstable()
-- I am not sure why this is necessary, but otherwise LuaMetaTeX resets
-- the functions table every time the getter is called