summaryrefslogtreecommitdiff
path: root/tex/context/base/l-table.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/l-table.lua')
-rw-r--r--tex/context/base/l-table.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/tex/context/base/l-table.lua b/tex/context/base/l-table.lua
index 1bd9921cb..1a871f0fe 100644
--- a/tex/context/base/l-table.lua
+++ b/tex/context/base/l-table.lua
@@ -82,7 +82,12 @@ function table.keys(t)
end
local function compare(a,b)
- return (tostring(a) < tostring(b))
+ local ta, tb = type(a), type(b) -- needed, else 11 < 2
+ if ta == tb then
+ return a < b
+ else
+ return tostring(a) < tostring(b)
+ end
end
local function sortedkeys(tab)
@@ -94,12 +99,10 @@ local function sortedkeys(tab)
else
local tkey = type(key)
if tkey == "string" then
- -- if kind == 2 then kind = 3 else kind = 1 end
kind = (kind == 2 and 3) or 1
elseif tkey == "number" then
- -- if kind == 1 then kind = 3 else kind = 2 end
kind = (kind == 1 and 3) or 2
- else -- if tkey then
+ else
kind = 3
end
end