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).
At startup the current_object was initialized incorrectly (setting its type
to object, but with a NULL object), resulting in a NULL pointer dereference
later on. (Fixes#902)
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)
The Object and Closure types in Python now support evaluation in a
boolean context and return False if the corresponding object was
destructed, True otherwise.
Struct member access is now done via the .members attribute of
structs and lvalues. For Struct objects this will return a member
object with .name, .type and .value attributes. For Lvalue objects
this will return an Lvalue for the given member.
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().
In Python the representation of an LPC object offers an attribute
variables, that contains all variables of that object with some
information about it and an attribute to change its value.
In Python the representation of an LPC object offers an attribute
functions, that contains all visible functions of that object
with some information about that function and the call operator.
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.