summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/syst-lua.lmt
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2023-04-27 00:04:07 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2023-04-27 00:04:07 +0200
commit6b25a7a970ba9553adf8077ef2eecb50a5d77818 (patch)
treef06e40077ba9e55af4bf6cab52313f79f8ea84a8 /tex/context/base/mkxl/syst-lua.lmt
parent657457ef4a08c1f000f272e00f654f4064cc37bd (diff)
downloadcontext-6b25a7a970ba9553adf8077ef2eecb50a5d77818.tar.gz
2023-04-26 23:31:00
Diffstat (limited to 'tex/context/base/mkxl/syst-lua.lmt')
-rw-r--r--tex/context/base/mkxl/syst-lua.lmt18
1 files changed, 18 insertions, 0 deletions
diff --git a/tex/context/base/mkxl/syst-lua.lmt b/tex/context/base/mkxl/syst-lua.lmt
index d8e06d4fd..0f80f57d3 100644
--- a/tex/context/base/mkxl/syst-lua.lmt
+++ b/tex/context/base/mkxl/syst-lua.lmt
@@ -58,6 +58,9 @@ local ctx_secondoftwoarguments = context.secondoftwoarguments
local ctx_firstofoneargument = context.firstofoneargument
local ctx_gobbleoneargument = context.gobbleoneargument
+local values = tokens.values
+local boolean_code = values.boolean
+
implement { -- will be overloaded later
name = "writestatus",
arguments = "2 arguments",
@@ -309,6 +312,21 @@ end
do
+ interfaces.implement {
+ name = "iflua",
+ public = true,
+ usage = "condition",
+ arguments = "string",
+ actions = function(s)
+ local c = load("return(" .. s .. ")")
+ return boolean_code, (c and c()) and true or false
+ end,
+ }
+
+end
+
+do
+
-- This is some 20% slower than native but we only provide this for compatibility
-- reasons so we don't care that much about it. Eventually we can drop the built-in
-- method.