Damien George
08d075592f
py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.
LOAD_METHOD bug was: emitbc did not correctly calculate the amount of
stack usage for a LOAD_METHOD operation.
small int bug was: int was being used to pass small ints, when it should
have been machine_int_t.
11 years ago
Damien George
b829b5caec
Implement mp_parse_node_free; print properly repr(string).
11 years ago
Paul Sokolovsky
aee2ba70de
Add parse_node_free_struct() and use it to free parse tree after compilation.
TODO: Check lexer/parse/compile error path for leaks too.
11 years ago
Damien George
00208ce194
py: Change macro var args in parser to be C99 compliant.
11 years ago
Damien George
55baff4c9b
Revamp qstrs: they now include length and hash.
Can now have null bytes in strings. Can define ROM qstrs per port using
qstrdefsport.h
11 years ago
Damien George
cbd2f7482c
py: Add module/function/class name to exceptions.
Exceptions know source file, line and block name.
Also tidy up some debug printing functions and provide a global
flag to enable/disable them.
11 years ago
Damien George
08335004cf
Add source file name and line number to error messages.
Byte code has a map from byte-code offset to source-code line number,
used to give better error messages.
11 years ago
Damien George
d02c6d8962
Implement eval.
11 years ago
Damien George
9528cd66d7
Convert parse errors to exceptions.
Parser no longer prints an error, but instead returns an exception ID
and message.
11 years ago
Paul Sokolovsky
80f60e1aee
Parse long Python ints properly.
Long int is something which doesn't fit into SMALL_INT partion of
machine_int_t. But it's also something which doesn't fit into
machine_int_t in the first place.
11 years ago
Damien George
69a818d418
py: Improve memory management for parser; add lexer error for bad line cont.
11 years ago
ian-v
5fd8fd2c16
Revert MP_BOOL, etc. and use <stdbool.h> instead
11 years ago
ian-v
7a16fadbf8
Co-exist with C++ (issue #85 )
11 years ago
Damien George
8cc96a35e5
Put unicode functions in unicode.c, and tidy their names.
11 years ago
Damien
732407f1bf
Change memory allocation API to require size for free and realloc.
11 years ago
Damien
dd12d1378f
Parse upper-case hex numbers correctly.
11 years ago
Damien
d99b05282d
Change object representation from 1 big union to individual structs.
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).
11 years ago
Damien
7410e440ab
Add basic complex number support.
11 years ago
Damien
df4b4f31ef
Make grammar rules const so the go in .text section.
11 years ago
Damien
5ac1b2efbd
Implement REPL.
11 years ago
Damien
0efb3a1b66
Tidy up SMALL_INT optimisations and CPython compatibility.
11 years ago
Damien
c025ebb2dc
Separate out mpy core and unix version.
11 years ago
Damien
91d387de7d
Improve indent/dedent error checking and reporting.
11 years ago
Damien
b14de21fc8
Optimise typedargslist_name to not create a node if just an id.
11 years ago
Damien
5fa5ae40be
Make range of small int 24 bits.
11 years ago
Damien
826005c60b
Add support for inline thumb assembly.
11 years ago
Damien
429d71943d
Initial commit.
11 years ago