diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-04-02 16:25:10 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-04-02 16:25:10 +0200 |
commit | 15ab7c153a96a9befc4e2c1774e701f3c941cc2d (patch) | |
tree | 4262a9085036949283dd3e56d992111a9745c680 /tex/context/base/mkiv/lxml-tex.lua | |
parent | 37c561c2f98d84fc02011b7b819ae8cf9bb4b10d (diff) | |
download | context-15ab7c153a96a9befc4e2c1774e701f3c941cc2d.tar.gz |
2018-04-02 15:51:00
Diffstat (limited to 'tex/context/base/mkiv/lxml-tex.lua')
-rw-r--r-- | tex/context/base/mkiv/lxml-tex.lua | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua index f1abab9e7..b8280ba9c 100644 --- a/tex/context/base/mkiv/lxml-tex.lua +++ b/tex/context/base/mkiv/lxml-tex.lua @@ -64,10 +64,11 @@ local xmlrename = xml.rename local variables = interfaces and interfaces.variables or { } -local settings_to_hash = utilities.parsers.settings_to_hash -local settings_to_set = utilities.parsers.settings_to_set -local options_to_hash = utilities.parsers.options_to_hash -local options_to_array = utilities.parsers.options_to_array +local parsers = utilities.parsers +local settings_to_hash = parsers.settings_to_hash +local settings_to_set = parsers.settings_to_set +local options_to_hash = parsers.options_to_hash +local options_to_array = parsers.options_to_array local insertbeforevalue = utilities.tables.insertbeforevalue local insertaftervalue = utilities.tables.insertaftervalue @@ -468,7 +469,7 @@ lxml.addindex = addindex implement { name = "xmladdindex", - arguments = { "string" }, + arguments = "string", actions = addindex, } @@ -820,7 +821,7 @@ local k_parser = class * spaces * key * spaces * rest --value implement { name = "xmlinstalldirective", - arguments = { "string", "string" }, + arguments = "2 strings", actions = function(name,csname) if csname then local keyvalueparser = k_parser / context[csname] @@ -1989,6 +1990,37 @@ do contextsprint(notcatcodes,att) end + local ctx_doif = commands.doif + local ctx_doifnot = commands.doifnot + local ctx_doifelse = commands.doifelse + + implement { + name = "xmldoifatt", + arguments = "3 strings", + actions = function(id,l,v) + local e = getid(id) + ctx_doif(e and e.at[k] == v or false) + end + } + + implement { + name = "xmldoifnotatt", + arguments = "3 strings", + actions = function(id,l,v) + local e = getid(id) + ctx_doifnot(e and e.at[k] == v or false) + end + } + + implement { + name = "xmldoifelseatt", + arguments = "3 strings", + actions = function(id,l,v) + local e = getid(id) + ctx_doifelse(e and e.at[k] == v or false) + end + } + end do |