| 1 |
----Copyright (C) 2019--2022 by Marcel Krueger |
| 2 |
--- |
| 3 |
--- This file may be distributed and/or modified under the |
| 4 |
--- conditions of the LaTeX Project Public License, either |
| 5 |
--- version 1.3c of this license or (at your option) any later |
| 6 |
--- version. The latest version of this license is in: |
| 7 |
--- |
| 8 |
--- http://www.latex-project.org/lppl.txt |
| 9 |
--- |
| 10 |
--- and version 1.3 or later is part of all distributions of |
| 11 |
--- LaTeX version 2005/12/01 or later. |
| 12 |
local func_tbl = lua.get_functions_table() |
| 13 |
local set_lua = token.set_lua |
| 14 |
local new_luafunction = luatexbase.new_luafunction |
| 15 |
return function(name, func, ...) |
| 16 |
local idx = new_luafunction(name) |
| 17 |
set_lua(name, idx, ...) |
| 18 |
func_tbl[idx] = func |
| 19 |
end |