summaryrefslogtreecommitdiff
path: root/py/lexerunix.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-12-05 19:35:18 +0000
committerDamien George <damien.p.george@gmail.com>2014-12-05 19:35:18 +0000
commita4c52c5a3d19b5527023fedfaae96cb717d03802 (patch)
tree2974180c7270bd13df2e5f080cf951a22c559baa /py/lexerunix.c
parent41c07d5b8063d752d2b3e41056bdee3615b54635 (diff)
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 'py/lexerunix.c')
-rw-r--r--py/lexerunix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/lexerunix.c b/py/lexerunix.c
index 52eac9eda..8e3241ad0 100644
--- a/py/lexerunix.c
+++ b/py/lexerunix.c
@@ -30,6 +30,7 @@
#if MICROPY_HELPER_LEXER_UNIX
#include <stdio.h>
+#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>