| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
| |
Previously, a failed malloc/realloc would throw an exception, which was
not caught. I think it's better to keep the parser free from NLR
(exception throwing), hence this patch.
|
| |
|
|
|
|
|
|
| |
This does not affect code size or performance when debugging turned off.
To address issue #420.
|
|
|
|
| |
A malloc/realloc fail now throws MemoryError.
|
|
|
|
|
|
|
| |
One of the reason for separate "message" (besides still unfulfilled desire to
optimize memory usage) was apparent special handling of exception with
messages by CPython. Well, the message is still just an exception argument,
it just printed specially. Implement that with PRINT_EXC printing format.
|
|
|
|
|
|
|
| |
Mostly just a global search and replace. Except rt_is_true which
becomes mp_obj_is_true.
Still would like to tidy up some of the names, but this will do for now.
|
| |
|
|
|
|
| |
Addresses issue #388.
|
|
|
|
|
| |
To comply with Python semantics and allow use of mp_obj_is_subclass_fast()
for exception matching.
|
|
|
|
|
| |
Only exceptions that are actually used are left prefedined. Hierarchy
is still there, and removed exceptions are just commented out.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This gets "value" of exceptions in the sense as it's defined for
StopIteration.value (i.e. args[0] or None).
TODO: This really should be inline function.
|
|\ \
| | |
| | |
| | | |
pfalcon-gen-close-ret-val
|
| | |
| | |
| | |
| | |
| | |
| | | |
Return with value gets converted to StopIteration(value). Implementation
keeps optimizing against creating of possibly unneeded exception objects,
so there're considerable refactoring to implement these features.
|
| |/
|/| |
|
| |
| |
| |
| |
| | |
They still exist in commented-out form in objexcept.c if they are ever
needed.
|
|/ |
|
| |
|
|
|
|
| |
arguments). Comment out the errors that aren't needed if memory becomes an issue.
|
| |
|
|
|
|
| |
Remove unnecessary includes. Add includes that improve portability.
|
| |
|
|
|
|
|
| |
Addresses issue #290, and hopefully sets up things to allow generators
throwing exceptions, etc.
|
|
|
|
| |
Thanks to @pfalcon for the tip!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Each built-in exception is now a type, with base type BaseException.
C exceptions are created by passing a pointer to the exception type to
make an instance of. When raising an exception from the VM, an
instance is created automatically if an exception type is raised (as
opposed to an exception instance).
Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper.
Handling of parse error changed to match new exceptions.
mp_const_type renamed to mp_type_type for consistency.
|
|
|
|
|
|
| |
Ultimately all static strings should be qstr. This entry in the type
structure is only used for printing error messages (to tell the type of
the bad argument), and printing objects that don't supply a .print method.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Some tools do not support local/static symbols (one example is GNU ld map file).
Exposing all functions will allow to do detailed size comparisons, etc.
Also, added bunch of statics where they were missing, and replaced few identity
functions with global mp_identity().
|
| |
|
| |
|
|
|
|
|
| |
Can now have null bytes in strings. Can define ROM qstrs per port using
qstrdefsport.h
|
| |
|
|
|
|
|
|
|
| |
Exceptions know source file, line and block name.
Also tidy up some debug printing functions and provide a global
flag to enable/disable them.
|
|
|
|
|
| |
Byte code has a map from byte-code offset to source-code line number,
used to give better error messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change state layout in VM so the stack starts at state[0] and grows
upwards. Locals are at the top end of the state and number downwards.
This cleans up a lot of the interface connecting the VM to C: now all
functions that take an array of Micro Python objects are in order (ie no
longer in reverse).
Also clean up C API with keyword arguments (call_n and call_n_kw
replaced with single call method that takes keyword arguments). And now
make_new takes keyword arguments.
emitnative.c has not yet been changed to comply with the new order of
stack layout.
|
| |
|
|
|
|
|
|
|
| |
This implements internal args tuple of arguments, while still keeping
object useful for reporting C-side errors.
Further elaboration is needed.
|
|
|
|
| |
Addresses issue #104.
|
|\
| |
| |
| |
| |
| |
| | |
ian-v-cplusplus
Conflicts:
py/objcomplex.c
|
|/ |
|
| |
|
|
|
|
| |
Now much more inline with how CPython does types.
|
| |
|
|
A big change. Micro Python objects are allocated as individual structs
with the first element being a pointer to the type information (which
is itself an object). This scheme follows CPython. Much more flexible,
not necessarily slower, uses same heap memory, and can allocate objects
statically.
Also change name prefix, from py_ to mp_ (mp for Micro Python).
|