diff options
author | Damien George <damien.p.george@gmail.com> | 2014-12-05 19:35:18 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-12-05 19:35:18 +0000 |
commit | a4c52c5a3d19b5527023fedfaae96cb717d03802 (patch) | |
tree | 2974180c7270bd13df2e5f080cf951a22c559baa /bare-arm | |
parent | 41c07d5b8063d752d2b3e41056bdee3615b54635 (diff) | |
download | micropython-a4c52c5a3d19b5527023fedfaae96cb717d03802.tar.gz micropython-a4c52c5a3d19b5527023fedfaae96cb717d03802.zip |
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.
Diffstat (limited to 'bare-arm')
-rw-r--r-- | bare-arm/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bare-arm/main.c b/bare-arm/main.c index 476a08ba0b..3c187e5fb0 100644 --- a/bare-arm/main.c +++ b/bare-arm/main.c @@ -32,7 +32,7 @@ void do_str(const char *src) { } // parse okay - qstr source_name = mp_lexer_source_name(lex); + qstr source_name = lex->source_name; mp_lexer_free(lex); mp_obj_t module_fun = mp_compile(pn, source_name, MP_EMIT_OPT_NONE, true); |