Commit Graph

17 Commits

Author SHA1 Message Date
Lars Mueller
7486f184c3 Serialize: Restore forward compatibility 2022-09-11 19:27:18 +02:00
Lars Mueller
6c24dc4e23 Serialize: Use numbers for refs to work around LuaJIT limits 2022-09-11 19:27:02 +02:00
Lars Müller
ac4eb746fe
Deserialization: Restore backwards compat (#12519) 2022-07-14 20:50:21 +02:00
Lars Müller
3eafcab64e
Builtin: Redo serialize.lua (#11427)
Features:

* Support for arbitrary references, including self-referencing
* Short output, references "long" strings as a bonus
* Around the same speed, potentially slower if long, short keys are present
* Properly works with NaN and inf
2022-06-11 20:00:26 +02:00
HybridDog
5355cb1d87
minetest.serialize: Reversible number serialization (#9722)
* minetest.serialize: Reversible number to string conversion

The %a format is not supported in Lua 5.1.
This commit also adds two tests for number serialization.
2020-04-22 16:43:48 +02:00
sfan5
8d6a0b917c
Fix potential security issue(s), documentation on minetest.deserialize() (#9369)
Also adds an unittest
2020-03-05 22:03:04 +01:00
rubenwardy
1173ff0c13
Add Lua unit tests to builtin using busted (#9184) 2020-01-18 02:09:18 +00:00
rubenwardy
8e757859d6
Add luacheck to check builtin (#7895) 2019-08-06 19:30:18 +01:00
SmallJoker
6945f807ab minetest.deserialize: Throw error when argument not string (#5738) 2017-05-09 23:11:20 +02:00
Rui914
24e8b0ac1e Faster insertion into table 2016-03-06 23:42:04 +00:00
ShadowNinja
cd4324e5a8 Fix serialization of floating point numbers 2015-02-21 13:16:18 -05:00
ShadowNinja
47aca6f6d1 Fix imprecise serialization of large numbers 2015-01-25 20:19:35 -05:00
Diego Martínez
c9669e90bb Fix typo in serialize.lua. 2015-01-15 16:16:41 -05:00
ShadowNinja
6afdb22ba7 Tweak core.serialize
This adds proper support for nested tables and improves performance a bit.
2014-11-19 12:40:54 -05:00
ShadowNinja
882e12f8ab Rework dumping functions
Changes:
  * Add comments to explain the dumping code
  * Add support for dumping values of any type (as '<' <type> '>')
  * Add support for tables as keys in dump2()
  * Make dump2() return it's result (like dump()) rather than printing it
  * Simplify and optimize function serialization via serialize()
2014-05-24 17:32:42 -04:00
ShadowNinja
c4359ff65c Use "core" namespace internally 2014-05-08 13:02:04 -04:00
ShadowNinja
1cd512913e Organize builtin into subdirectories 2014-05-07 17:14:23 -04:00