From a4c52c5a3d19b5527023fedfaae96cb717d03802 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 5 Dec 2014 19:35:18 +0000 Subject: 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. --- py/builtinimport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/builtinimport.c') diff --git a/py/builtinimport.c b/py/builtinimport.c index c96a7d4ae..2910f8d97 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -127,7 +127,7 @@ STATIC void do_load(mp_obj_t module_obj, vstr_t *file) { } #if MICROPY_PY___FILE__ - qstr source_name = mp_lexer_source_name(lex); + qstr source_name = lex->source_name; mp_store_attr(module_obj, MP_QSTR___file__, MP_OBJ_NEW_QSTR(source_name)); #endif -- cgit v1.2.3