summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/syst-lua.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/syst-lua.lua')
-rw-r--r--tex/context/base/mkiv/syst-lua.lua42
1 files changed, 10 insertions, 32 deletions
diff --git a/tex/context/base/mkiv/syst-lua.lua b/tex/context/base/mkiv/syst-lua.lua
index 422f57a00..ee3b8c327 100644
--- a/tex/context/base/mkiv/syst-lua.lua
+++ b/tex/context/base/mkiv/syst-lua.lua
@@ -10,92 +10,70 @@ local find, match = string.find, string.match
local tonumber = tonumber
local S, C, P, lpegmatch, lpegtsplitat = lpeg.S, lpeg.C, lpeg.P, lpeg.match, lpeg.tsplitat
+commands = commands or { }
+local commands = commands
+local context = context
+local implement = interfaces.implement
-commands = commands or { }
-local commands = commands
-
-local implement = interfaces.implement
+local ctx_protected_cs = context.protected.cs -- more efficient
+local ctx_firstoftwoarguments = ctx_protected_cs.firstoftwoarguments
+local ctx_secondoftwoarguments = ctx_protected_cs.secondoftwoarguments
+local ctx_firstofoneargument = ctx_protected_cs.firstofoneargument
+local ctx_gobbleoneargument = ctx_protected_cs.gobbleoneargument
local two_strings = interfaces.strings[2]
-local context = context
-local csprint = context.sprint
-
-local prtcatcodes = tex.prtcatcodes
-
-implement { -- will b eoverloaded later
+implement { -- will be overloaded later
name = "writestatus",
arguments = two_strings,
actions = logs.status,
}
-local ctx_firstoftwoarguments = context.firstoftwoarguments -- context.constructcsonly("firstoftwoarguments" )
-local ctx_secondoftwoarguments = context.secondoftwoarguments -- context.constructcsonly("secondoftwoarguments")
-local ctx_firstofoneargument = context.firstofoneargument -- context.constructcsonly("firstofoneargument" )
-local ctx_gobbleoneargument = context.gobbleoneargument -- context.constructcsonly("gobbleoneargument" )
-
--- contextsprint(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
--- contextsprint(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
--- contextsprint(prtcatcodes,[[\ui_ft]]) -- ctx_firstoftwoarguments
--- contextsprint(prtcatcodes,[[\ui_st]]) -- ctx_secondoftwoarguments
-
function commands.doifelse(b)
if b then
ctx_firstoftwoarguments()
--- csprint(prtcatcodes,[[\ui_ft]]) -- ctx_firstoftwoarguments
else
ctx_secondoftwoarguments()
--- csprint(prtcatcodes,[[\ui_st]]) -- ctx_secondoftwoarguments
end
end
function commands.doifelsesomething(b)
if b and b ~= "" then
ctx_firstoftwoarguments()
--- csprint(prtcatcodes,[[\ui_ft]]) -- ctx_firstoftwoarguments
else
ctx_secondoftwoarguments()
--- csprint(prtcatcodes,[[\ui_st]]) -- ctx_secondoftwoarguments
end
end
function commands.doif(b)
if b then
ctx_firstofoneargument()
--- context.__flushdirect(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
else
ctx_gobbleoneargument()
--- context.__flushdirect(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
end
end
function commands.doifsomething(b)
if b and b ~= "" then
ctx_firstofoneargument()
--- context.__flushdirect(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
else
ctx_gobbleoneargument()
--- context.__flushdirect(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
end
end
function commands.doifnot(b)
if b then
ctx_gobbleoneargument()
--- csprint(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
else
ctx_firstofoneargument()
--- csprint(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
end
end
function commands.doifnotthing(b)
if b and b ~= "" then
ctx_gobbleoneargument()
--- csprint(prtcatcodes,[[\ui_go]]) -- ctx_gobbleonearguments
else
ctx_firstofoneargument()
--- csprint(prtcatcodes,[[\ui_fo]]) -- ctx_firstofonearguments
end
end