diff options
Diffstat (limited to 'tex/context/base/mkiv/syst-aux.lua')
-rw-r--r-- | tex/context/base/mkiv/syst-aux.lua | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/tex/context/base/mkiv/syst-aux.lua b/tex/context/base/mkiv/syst-aux.lua index 4d81c4140..05a070d30 100644 --- a/tex/context/base/mkiv/syst-aux.lua +++ b/tex/context/base/mkiv/syst-aux.lua @@ -14,7 +14,6 @@ if not modules then modules = { } end modules ['syst-aux'] = { local tonumber, next, type = tonumber, next, type local utfsub = utf.sub local P, S, R, C, Cc, Cs, Carg, lpegmatch = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Carg, lpeg.match -local next = next local find, formatters = string.find, string.formatters local context = context @@ -840,121 +839,3 @@ implement { public = true, actions = function() getshape("widowpenalties") end, } - -if CONTEXTLMTXMODE > 0 then - - -- This is kind of tricky and might not work for all csnames but as long as we use - -- it in a controlled way, we're okay. The engine implementation might be changed - -- a bit (no need to go through strings, but fetching a cs index and passing that - -- back also takes time). - - -- Another approach is to have the predefined stack operate use private stacks and - -- then the pop doesn't need the cs. But ... we then also need to store stuff in - -- the format so that complicates maters more than I'm willing to do. - - local insert, remove = table.insert, table.remove - - local push_macro = token.push_macro - local pop_macro = token.pop_macro - local scan_csname = token.scan_csname - - local stack = table.setmetatableindex("table") - - local report = logs.reporter("system","macrostack") - - local function pushmacro(name,global) - local s = push_macro(name,global) - if s then - insert(stack[name],s) - else - report("no macro %a",name) - insert(stack[name],false) - end - end - - local function popmacro(name) - local s = remove(stack[name]) - if s then - pop_macro(s) - else - -- error - end - end - - tokens.pushmacro = pushmacro - tokens.popmacro = popmacro - - interfaces.implement { - name = "localpushmacro", - public = true, - protected = true, - actions = function() - pushmacro(scan_csname()) - end - } - - interfaces.implement { - name = "globalpushmacro", - public = true, - protected = true, - actions = function() - pushmacro(scan_csname(),true) - end - } - - interfaces.implement { - name = "localpopmacro", - public = true, - protected = true, - actions = function() - popmacro(scan_csname()) - end - } - - interfaces.implement { - name = "globalpopmacro", - public = true, - protected = true, - actions = function() - popmacro(scan_csname()) - end - } - - interfaces.implement { - name = "showmacrostack", - public = true, - protected = true, - actions = function() - local n = scan_csname() - local s = stack[n] - local m = #s - report("%s : %i stack slots used",n,m) - for i=1,m do - report("% 3i %S",i,s[i]) - end - end - } - -end - --- For the moment here: - -if CONTEXTLMTXMODE > 0 then - - local create = token.create - local gobble = token.gobble - - implement { - name = "gobblenested", - public = true, - protected = true, - arguments = "3 strings", - actions = function(start,stop,command) - gobble(create(start),create(stop)) - if command then - context[command]() - end - end - } - -end |