diff options
Diffstat (limited to 'tex/context/base/mkiv/util-str.lua')
-rw-r--r-- | tex/context/base/mkiv/util-str.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua index 68c9be586..4d23f88b7 100644 --- a/tex/context/base/mkiv/util-str.lua +++ b/tex/context/base/mkiv/util-str.lua @@ -701,14 +701,18 @@ local format_left = function(f) end end -local format_q = function() +local format_q = JITSUPPORTED and function() n = n + 1 -- lua 5.3 has a different q than lua 5.2 (which does a tostring on numbers) -- return format("(a%s ~= nil and format('%%q',a%s) or '')",n,n) return format("(a%s ~= nil and format('%%q',tostring(a%s)) or '')",n,n) -- return format("(a%s ~= nil and escapedquotes(tostring(a%s)) or '')",n,n) +end or function() + n = n + 1 + return format("(a%s ~= nil and format('%%q',a%s) or '')",n,n) end + local format_Q = function() -- fast escaping n = n + 1 -- return format("format('%%q',tostring(a%s))",n) |