Damien George
9bf5f2857d
py: Add further checks for failed malloc in lexer init functions.
10 years ago
Damien George
94fbe9711a
py: Change lexer stream API to return bytes not chars.
Lexer is now 8-bit clean inside strings.
10 years ago
Paul Sokolovsky
59c675a64c
py: Include mpconfig.h before all other includes.
It defines types used by all other headers.
Fixes #691 .
11 years ago
Damien George
58ebde4664
Tidy up some configuration options.
MP_ALLOC_* -> MICROPY_ALLOC_*
MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX
MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL
MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX
MICROPY_EXTRA_* -> MICROPY_PORT_*
See issue #35 .
11 years ago
Damien George
04b9147e15
Add license header to (almost) all files.
Blanket wide to all .c and .h files. Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.
Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
11 years ago
Damien George
185f9c1c46
py: Fix lexerunix, where not all data may be read from a file.
Addresses issue #526 .
11 years ago
Damien George
b502156e22
py: Adjust #includes in lexerunix.c.
11 years ago
Ilya Dmitrichenko
8e9482a3c3
py: don't look for any additional headers when lexerunix is disabled
11 years ago
Damien George
ffa9bddfc4
Make lexerunix not allocate RAM for the entire script.
Now reads in small chunks at a time.
11 years ago
xbe
efe3422394
py: Clean up includes.
Remove unnecessary includes. Add includes that improve portability.
11 years ago
Paul Sokolovsky
9110896063
Remove older import helpers, no longer used.
11 years ago
Paul Sokolovsky
e11b17c25f
Implement support for sys.path when loading modules.
sys.path is not initialized by rt_init(), that's left for platform-specific
startup code. (For example, bare metal port may have some hardcoded defaults,
and let user change sys.path directly; while port for OS with environment
feature can take path from environment). If it's not explicitly initialized,
modules will be imported only from a current directory.
11 years ago
Damien George
b829b5caec
Implement mp_parse_node_free; print properly repr(string).
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
9193f89296
Move lexerstr to main py directory (everyone uses it).
11 years ago
John R. Lenton
9c83ec0eda
Merge remote-tracking branch 'upstream/master' into dict_feats
11 years ago
Damien George
d3ebe4829d
Factor and simplify Makefile's and mpconfig, part 2.
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
66028ab6dc
Basic implementation of import.
import works for simple cases. Still work to do on finding the right
script, and setting globals/locals correctly when running an imported
function.
11 years ago
Damien
732407f1bf
Change memory allocation API to require size for free and realloc.
11 years ago
Paul Sokolovsky
44d0f3cfa2
Handle return value of read() call.
11 years ago
Damien
de690d128b
Add unix-cpy, used to test Micro Python byte code against CPython.
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
d276f6357e
Get unix version compling.
11 years ago
Damien
a5185f4bc8
Abstract out back-end stream functionality from lexer.
11 years ago