diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/trac-lmx.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/trac-lmx.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/context/base/trac-lmx.lua b/Master/texmf-dist/tex/context/base/trac-lmx.lua index 664815c6618..b4bfc36d6e9 100644 --- a/Master/texmf-dist/tex/context/base/trac-lmx.lua +++ b/Master/texmf-dist/tex/context/base/trac-lmx.lua @@ -10,9 +10,15 @@ if not modules then modules = { } end modules ['trac-lmx'] = { local gsub, format, concat, byte = string.gsub, string.format, table.concat, string.byte -lmx = lmx or { } +local allocate = utilities.storage.allocate -local escapes = { +lmx = lmx or { } +local lmx = lmx + +lmx.variables = allocate() +local lmxvariables = lmx.variables + +local escapes = allocate { ['&'] = '&', ['<'] = '<', ['>'] = '>', @@ -21,10 +27,6 @@ local escapes = { -- variables -lmx.variables = { } -- global, shared - -local lmxvariables = lmx.variables - lmxvariables['title-default'] = 'ConTeXt LMX File' lmxvariables['title'] = lmx.variables['title-default'] lmxvariables['color-background-green'] = '#4F6F6F' @@ -67,7 +69,7 @@ local function do_urlescaped(str) return (gsub(str,"[^%a%d]",format("%%0x",byte("%1")))) end -function do_type(str) +local function do_type(str) if str then do_print("<tt>" .. do_escape(str) .. "</tt>") end end @@ -76,7 +78,7 @@ local function do_variable(str) end function lmx.loadedfile(name) - name = (resolvers and resolvers.find_file and resolvers.find_file(name)) or name + name = (resolvers and resolvers.findfile and resolvers.findfile(name)) or name return io.loaddata(name) end |