Previously pragma save_local_names was only used to store information of
variables of coroutines to be inspected by Python code. Extend this to
all local variables.
Python can register global struct definitions via ldmud.register_struct().
Also added corresponding namespace ldmud.registered_structs that contains
all registered struct types.
Fully support the LPC type system in Python, providing representations
for basic types (int, float, string, bytes), named (lightweight) object
types, concrete struct types and union types.
The global interpreter lock is acquired during initialization and never
released. So if any Python modules start additional threads they can
hardly run, because the lock is held by the main thread mostly all of
the time.
Include any LPC data exclusively held by Python code in the cleanup process,
which is to remove any dangling object references (replacing with 0 or
removing from mappings).
Add a new type and data structure to LPC. Lightweight objects combine
properties from structs (small memory footprint, automatic lifetime
management) and objects (capsulation, functions).
(Implements #688)
When active the compiler will warn about variables that are not used,
i.e. not read from or not written to. The warning differentiates between
variables that were just declared, variables that were written to or
variables that were only read from. Taking a reference from a variable
is seen as a read/write access, so no warning afterwards.
When checking the number of arguments for calls to Python efuns,
the existence of ellipsis in the argument list were ignored,
resulting in false compile errors.
When lfun or variable objects are created, we need to make sure,
the indices are adjusted if a replace_program() is in progress.
Just like closures we create a protector structure that will be
processed after the replace_program().
If Python efuns have type annotations they are evaluated
at compile and runtime. Even without annotations the number
of arguments are checked at compile time.
On a call to python efun closures the funstart entry
in the constrol stack was left uninitialized, resulting
in a crash when it that value was used to generate
the stack trace.