Commit Graph

91 Commits

Author SHA1 Message Date
Paul Kulchenko
ed98a21db6 Updated formatting. 2022-05-21 11:33:08 -07:00
Paul Kulchenko
b987a79adc Updated rockspec to reference tag and https URL (closes #42). 2022-03-25 21:35:05 -07:00
Paul Kulchenko
6e41f2ca07 Added option to change radix for floating numbers (closes #36, closes #37).
This is needed to produce a valid Lua code when a local locale setting
makes `format` to produce floating point numbers with a comma.

Limitation: only commas are being fixed in floating point numbers.
2020-11-05 21:04:43 -08:00
Paul Kulchenko
879580fb21 Added version number to numformat when the change was introduced (#17). 2019-02-20 16:47:06 -08:00
Paul Kulchenko
96106650b1 Updated to add a note on numformat option for better readability (#17). 2019-02-20 16:45:00 -08:00
Paul Kulchenko
522a6239f2 Updated copyright dates. 2018-04-23 20:57:30 -07:00
Peter Melnichenko
ecf3b48c83 Fixed incorrect sref name used for tables within table keys
`insref` argument of `val2str` explicitly sets name to use for a value
within the self reference section when it is seen again.

It's necessary to provide it for table keys, as they can only be
referenced through the `iname` storage table. For values sref name
can be calculated based on sref of the parent table and the key.

When serializing normal values (key is not a table or another special type),
`insref` was passed as is to the recursive `val2str` call. This is incorrect
when `insref` is actually present (i.e. parent table is a table key
or a value for a table key), the values should get their own sref names
instead of the parent name. Passing `nil` instead is enough to fix this.

Fixes #28, closes #30.
2018-04-23 20:57:22 -07:00
Peter Melnichenko
aedfe52d49 Use an scm rockspec instead of storing release rockspecs (closes #31).
Allows installing dev version of serpent using `luarocks make`.
There is no reason to store release rockspecs in the repo, they can be
generated using `luarocks new-version --tag <version>`.
2018-04-23 20:54:16 -07:00
Paul Kulchenko
33b12f1cb4 Updated to avoid calling metamethods when metatostring set to false (fixes #29). 2018-03-18 20:53:50 -07:00
Paul Kulchenko
a0e2a889b1 Fixed dates in the license (closes #27). 2017-11-08 07:38:01 -08:00
Paul Kulchenko
d786835976 Updated documentation for 0.30. 2017-09-01 21:35:14 -07:00
Paul Kulchenko
10be108506 Updated pairs to avoid using __pairs in Lua 5.2+.
Ref pkulchenko/MobDebug#27, pkulchenko/MobDebug#29.
2017-09-01 21:35:13 -07:00
Paul Kulchenko
679a5a3bca Added metatostring option to disable __tostring processing during serialization.
Ref pkulchenko/MobDebug#27, pkulchenko/MobDebug#29.
2017-09-01 21:35:04 -07:00
Paul Kulchenko
049e951ffb Added level to the parameters of the custom function (closes #25). 2017-08-31 22:20:30 -07:00
Paul Kulchenko
d304d81c09 Updated list formatting in the documentation for consistency. 2017-08-31 22:19:50 -07:00
Paul Kulchenko
5b5f694082 Added maxlength option to limit the space taken by table elements. 2017-02-18 22:27:33 -08:00
Paul Kulchenko
7f46cfda57 Optimized serialization of functions when nocode option is specified. 2017-02-17 21:55:40 -08:00
Paul Kulchenko
9f48b55391 Added protection from __serialize check failing (pkulchenko/ZeroBraneStudio#732).
This protects from run-time error `field or property __serialize does not exist`
on `getmetatable(t).__serialize` check in some Lua engines (for example, Unity).
2017-02-16 21:36:58 -08:00
Paul Kulchenko
545c8fc8a6 Added keyignore option for the serializer. 2015-07-24 21:40:43 -07:00
Paul Kulchenko
2d845adb49 Added check for environments that may not have 'default' tables as tables. 2015-05-18 21:11:16 -07:00
Paul Kulchenko
06a575ed69 Added numeric format to preserve floating point precision (closes #17). 2015-05-07 22:55:21 -07:00
Paul Kulchenko
dca4b8c1d8 Added using debug.metatable when available. 2015-05-07 22:42:24 -07:00
Paul Kulchenko
664b6eebea Improved handling of failures in __tostring (pkulchenko/ZeroBraneStudio#446). 2015-05-07 09:03:58 -07:00
Paul Kulchenko
d625641f65 Updated documentation for 0.28. 2015-05-06 23:27:44 -07:00
Paul Kulchenko
d78f212b71 Switched to a method proposed by @SoniEx2 to disallow function calls (#15). 2015-01-24 13:56:33 -08:00
Paul Kulchenko
9ed094ba07 Added more tostring for Lua 5.3 support (pkulchenko/ZeroBraneStudio#401). 2015-01-23 20:40:17 -08:00
Paul Kulchenko
a5bec96f46 Updated environment handling to localize the impact (#15). 2015-01-23 20:39:17 -08:00
Paul Kulchenko
3fcbb72531 Added setting env to protect against assigning global functions (closes #15). 2015-01-20 20:54:33 -08:00
Paul Kulchenko
ce5281c1f5 Updated tests to work with Lua 5.3. 2015-01-20 20:30:36 -08:00
Paul Kulchenko
7ff75bebd7 Updated copyright year. 2015-01-19 21:54:46 -08:00
Paul Kulchenko
0c5b2603bb Added explicit tostring for Lua 5.3 with LUA_NOCVTN2S set (pkulchenko/ZeroBraneStudio#401). 2015-01-19 21:45:42 -08:00
Paul Kulchenko
026f4e1a5c Updated version number. 2014-01-30 16:06:05 -08:00
Tommy Nguyen
8d55e4bc56 Fixed crash when not all Lua standard libraries are loaded. 2014-01-31 00:34:33 +01:00
Paul Kulchenko
f2fc9e7517 Improved Lua 5.2 support for serialized functions. 2014-01-19 21:40:03 -08:00
Paul Kulchenko
8070d1edbb Updated documentation for 0.27. 2014-01-11 10:38:08 -08:00
Paul Kulchenko
ca4140a2d1 Fixed (properly this time) order of elements in the array part (fixes #13). 2014-01-10 16:05:19 -08:00
Paul Kulchenko
7d56d50a9c Fixed order of elements in the array part with sortkeys=true (fixes #13). 2014-01-10 10:27:26 -08:00
Paul Kulchenko
06873d12cd Updated custom formatter documentation (closes #11). 2014-01-09 14:05:47 -08:00
Paul Kulchenko
4e4a19df1d Added load function to deserialize; updated documentation (closes #9). 2013-11-05 11:52:05 -08:00
Paul Kulchenko
b290a5d522 Added spec for 0.25. 2013-11-02 19:22:28 -07:00
Paul Kulchenko
6bc848da7d Updated documentation to clarify defaults and the difference between serialization and pretty printing (ref #9). 2013-11-02 19:20:59 -07:00
Paul Kulchenko
69e760de17 Updated LICENSE information. 2013-10-05 22:55:14 -07:00
Paul Kulchenko
a4e258cb77 Fixed an issue with mixed tables that may be missing keys.
Earlier optimization depended on incorrect assumption that `next` can be
started by using #t, which is not the case.
2013-10-01 20:52:34 -07:00
Paul Kulchenko
29d2e11920 Optimized processing of tables with numeric indexes. 2013-09-30 21:17:59 -07:00
Paul Kulchenko
115b30ea77 Added maxnum option to limit the number of elements in tables. 2013-09-29 14:33:15 -07:00
Paul Kulchenko
28d1f0f49d Updated documentation for 0.24. 2013-06-12 11:06:02 -07:00
Paul Kulchenko
f7b2a819c0 Fixed an issue missing numerical keys (fixes #8). 2013-06-12 11:04:56 -07:00
Paul Kulchenko
2d09171357 Fixed an issue with luaffi that returns getmetatable(ffi.C) as true. 2013-06-11 00:02:22 -07:00
Paul Kulchenko
0c1483c799 Added support for cdata type in LuaJIT (thanks to [Evan](https://github.com/neomantra)). 2013-03-24 15:23:31 -07:00
Paul Kulchenko
a716bd877d Added comment to indicate incomplete output. 2013-03-22 15:00:55 -07:00