diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-22 22:33:21 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-07-22 22:33:21 +0200 |
commit | dd7c4b1a54bfc5e358eb9f766c0b865fc47cbe46 (patch) | |
tree | 2e8888da6188eb742a98c3c05a26e2b75b198e62 /tex/context/base/mkiv/syst-lua.lua | |
parent | 50928735daee408de73737b055b2535d96424824 (diff) | |
download | context-dd7c4b1a54bfc5e358eb9f766c0b865fc47cbe46.tar.gz |
2016-07-22 20:13:00
Diffstat (limited to 'tex/context/base/mkiv/syst-lua.lua')
-rw-r--r-- | tex/context/base/mkiv/syst-lua.lua | 42 |
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 0cbcd6988..d35a5111a 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 protectedcs = context.protectedcs -- efficient +local ctx_firstoftwoarguments = protectedcs.firstoftwoarguments +local ctx_secondoftwoarguments = protectedcs.secondoftwoarguments +local ctx_firstofoneargument = protectedcs.firstofoneargument +local ctx_gobbleoneargument = protectedcs.gobbleoneargument local two_strings = interfaces.strings[2] -local context = context ------ 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 |