summaryrefslogtreecommitdiff
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-09 12:27:39 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-09 12:27:39 +0100
commit78035b995ff7bd518cc1291aa70c966b53510fd9 (patch)
treeb401d96d1a29db9cc7c87beedc9c829cc46e56f8 /py/compile.c
parentfc18c8e834a1ed72b9f61d82cd00099a4de1eab4 (diff)
py, compiler: Clean up and compress scope/compile structures.
Convert int types to uint where sensible, and then to uint8_t or uint16_t where possible to reduce RAM usage.
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/py/compile.c b/py/compile.c
index 95fe1d759..778e93282 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -38,16 +38,17 @@ typedef enum {
typedef struct _compiler_t {
qstr source_file;
- bool is_repl;
- pass_kind_t pass;
- bool had_error; // try to keep compiler clean from nlr
+ uint8_t is_repl;
+ uint8_t pass; // holds enum type pass_kind_t
+ uint8_t had_error; // try to keep compiler clean from nlr
+ uint8_t func_arg_is_super; // used to compile special case of super() function call
int next_label;
int break_label;
int continue_label;
int break_continue_except_level;
- int cur_except_level; // increased for SETUP_EXCEPT, SETUP_FINALLY; decreased for POP_BLOCK, POP_EXCEPT
+ uint16_t cur_except_level; // increased for SETUP_EXCEPT, SETUP_FINALLY; decreased for POP_BLOCK, POP_EXCEPT
int n_arg_keyword;
bool have_star_arg;
@@ -57,8 +58,6 @@ typedef struct _compiler_t {
int param_pass_num_dict_params;
int param_pass_num_default_params;
- bool func_arg_is_super; // used to compile special case of super() function call
-
scope_t *scope_head;
scope_t *scope_cur;