diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-04-16 09:53:19 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-04-16 09:53:19 +0200 |
commit | 32e6c720c4f84f112596c6b4a75193f99e9be158 (patch) | |
tree | 9a673cc26aa02f8a9e74d18fc821fb5f3cda5380 /tex/context/base/mkiv/syst-aux.lua | |
parent | ba81502d685bdba367e2a8f0bdff0f8ecc0cf7f6 (diff) | |
download | context-32e6c720c4f84f112596c6b4a75193f99e9be158.tar.gz |
2019-04-16 09:02:00
Diffstat (limited to 'tex/context/base/mkiv/syst-aux.lua')
-rw-r--r-- | tex/context/base/mkiv/syst-aux.lua | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/syst-aux.lua b/tex/context/base/mkiv/syst-aux.lua index 9b0ca82c4..15c2ca294 100644 --- a/tex/context/base/mkiv/syst-aux.lua +++ b/tex/context/base/mkiv/syst-aux.lua @@ -423,6 +423,9 @@ context.secondoftwoarguments = ctx_secondoftwoarguments context.firstofoneargument = ctx_firstofoneargument context.gobbleoneargument = ctx_gobbleoneargument +local ctx_iftrue = context.iftrue +local ctx_iffalse = context.iffalse + local hash = utilities.parsers.hashes.settings_to_set local function doifelsecommon(a,b) @@ -554,6 +557,45 @@ local function doifnotcommon(a,b) ctx_firstofoneargument() end +-- local function hascommonargumentcondition(a,b) +-- if a == b then +-- setmacro("commalistelement",a) +-- if a == "" then +-- ctx_iffalse() +-- else +-- ctx_iftrue() +-- end +-- return +-- end +-- local ba = find(a,",",1,true) +-- local bb = find(b,",",1,true) +-- if ba and bb then +-- local ha = hash[a] +-- local hb = hash[b] +-- for k in next, ha do +-- if hb[k] then +-- setmacro("commalistelement",k) +-- ctx_iftrue() +-- return +-- end +-- end +-- elseif ba then +-- if hash[a][b] then +-- setmacro("commalistelement",b) +-- ctx_iftrue() +-- return +-- end +-- elseif bb then +-- if hash[b][a] then +-- setmacro("commalistelement",a) +-- ctx_iftrue() +-- return +-- end +-- end +-- setmacro("commalistelement","") +-- ctx_iffalse() +-- end + local function doifelseinset(a,b) if a == b then setmacro("commalistelement",a) @@ -641,6 +683,13 @@ implement { arguments = "2 strings", } +-- implement { +-- name = "hascommonargumentcondition", +-- actions = hascommonargumentcondition, +-- arguments = "2 strings", +-- arguments = { "argument", "argument" }, +-- } + implement { name = "doifelseinset", actions = doifelseinset, |