Comparison

util/serialization.lua @ 12802:4a8740e01813

Merge 0.12->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 12 Dec 2022 07:10:54 +0100
parent 12782:8815d3090928
child 12975:d10957394a3c
comparison
equal deleted inserted replaced
12801:ebd6b4d8bf04 12802:4a8740e01813
19 local to_hex = require "util.hex".to; 19 local to_hex = require "util.hex".to;
20 20
21 local pcall = pcall; 21 local pcall = pcall;
22 local envload = require"util.envload".envload; 22 local envload = require"util.envload".envload;
23 23
24 if not math.type then
25 require "util.mathcompat"
26 end
27
24 local pos_inf, neg_inf = math.huge, -math.huge; 28 local pos_inf, neg_inf = math.huge, -math.huge;
25 local m_type = math.type or function (n) 29 local m_type = math.type;
26 return n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float";
27 end;
28 30
29 local function rawpairs(t) 31 local function rawpairs(t)
30 return next, t, nil; 32 return next, t, nil;
31 end 33 end
32 34