Damien George
4d77e1a034
py: Use m_{new,renew,del} consistently.
This is so all memory requests go through the same interface.
10 years ago
Damien George
51dfcb4bb7
py: Move to guarded includes, everywhere in py/ core.
Addresses issue #1022 .
10 years ago
Damien George
a4c52c5a3d
py: Optimise lexer by exposing lexer type.
mp_lexer_t type is exposed, mp_token_t type is removed, and simple lexer
functions (like checking current token kind) are now inlined.
This saves 784 bytes ROM on 32-bit unix, 348 bytes on stmhal, and 460
bytes on bare-arm. It also saves a tiny bit of RAM since mp_lexer_t
is a bit smaller. Also will run a bit more efficiently.
10 years ago
Damien George
9bf5f2857d
py: Add further checks for failed malloc in lexer init functions.
10 years ago
Dave Hylands
e20cbbec73
Make lexer fail gracefully when memory can't be allocated.
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
Damien George
54eb4e723e
lexer: Convert type (u)int to mp_(u)int_t.
11 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
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
xbe
efe3422394
py: Clean up includes.
Remove unnecessary includes. Add includes that improve portability.
11 years ago
Paul Sokolovsky
520e2f58a5
Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.
11 years ago
Damien George
b829b5caec
Implement mp_parse_node_free; print properly repr(string).
11 years ago
Paul Sokolovsky
39763c6cb0
lexerstr: Free mp_lexer_str_buf_t structure itself.
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