diff options
Diffstat (limited to 'tex/context/base/mkxl/syst-lua.lmt')
-rw-r--r-- | tex/context/base/mkxl/syst-lua.lmt | 18 |
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. |