summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-02 21:03:20 +0000
committerKarl Berry <karl@freefriends.org>2020-05-02 21:03:20 +0000
commit151fbc4b66cb3705f6ce20368a2c6f7c06b8d57d (patch)
treead303c8ecb185757d71d19adf509a2213dba4599 /Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua
parentbbae342b9a92bd7abbb840d473d99780fa823a75 (diff)
lualibs (2may20)
git-svn-id: svn://tug.org/texlive/trunk@54975 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua b/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua
index 68c9be5860b..aba7859c31e 100644
--- a/Master/texmf-dist/tex/luatex/lualibs/lualibs-util-str.lua
+++ b/Master/texmf-dist/tex/luatex/lualibs/lualibs-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)
@@ -1269,7 +1273,6 @@ local function make(t,str)
f = function() return str end
end
end
- -- if jit then jit.on(f,true) end
t[str] = f
return f
end