From 32e6c720c4f84f112596c6b4a75193f99e9be158 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Tue, 16 Apr 2019 09:53:19 +0200 Subject: 2019-04-16 09:02:00 --- tex/context/base/mkiv/syst-aux.lua | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'tex/context/base/mkiv/syst-aux.lua') 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, -- cgit v1.2.3