Module lib.serialize

Serialize an object into a source code string.

This string, when passed as an argument to loadstring()(), returns an object structurally identical to the original one. The following are currently supported: * strings, numbers, booleans, nil * functions without upvalues * tables thereof. Tables can have shared part, but can't be recursive yet. Caveat: metatables and environments aren't saved.

Functions

dump_or_ref_val (x) if x occurs multiple times, dump the local var rather than the value.
dump_val (x) Second pass, dump the object; subparts occuring multiple times are dumped in local variables which can be referenced multiple times; care is taken to dump locla vars in asensible order.


Functions

dump_or_ref_val (x)
if x occurs multiple times, dump the local var rather than the value. If it's the first time it's dumped, also dump the content in localdefs.

Parameters:

  • x
dump_val (x)
Second pass, dump the object; subparts occuring multiple times are dumped in local variables which can be referenced multiple times; care is taken to dump locla vars in asensible order.

Parameters:

  • x
generated by LDoc 1.5.0 Last updated 2025-05-24 09:49:55