aboutsummaryrefslogtreecommitdiff
path: root/py/emit.h
diff options
context:
space:
mode:
authorDamien George2014-12-27 17:20:41 +0000
committerDamien George2014-12-27 17:33:30 +0000
commit83204f34067b765293b791563bdd5756bdfc5aa4 (patch)
treec3492e6ba82b9c1ae00cfe4cf33b359bec486fe1 /py/emit.h
parente37dcaafb43c1246ab55d79ebb8889a61f280533 (diff)
py: Allow to properly disable builtin slice operation.
This patch makes the MICROPY_PY_BUILTINS_SLICE compile-time option fully disable the builtin slice operation (when set to 0). This includes removing the slice sytanx from the grammar. Now, enabling slice costs 4228 bytes on unix x64, and 1816 bytes on stmhal.
Diffstat (limited to 'py/emit.h')
-rw-r--r--py/emit.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/emit.h b/py/emit.h
index bc72b3cb3..927e33ea7 100644
--- a/py/emit.h
+++ b/py/emit.h
@@ -132,7 +132,9 @@ typedef struct _emit_method_table_t {
void (*build_set)(emit_t *emit, mp_uint_t n_args);
void (*set_add)(emit_t *emit, mp_uint_t set_stack_index);
#endif
+ #if MICROPY_PY_BUILTINS_SLICE
void (*build_slice)(emit_t *emit, mp_uint_t n_args);
+ #endif
void (*unpack_sequence)(emit_t *emit, mp_uint_t n_args);
void (*unpack_ex)(emit_t *emit, mp_uint_t n_left, mp_uint_t n_right);
void (*make_function)(emit_t *emit, scope_t *scope, mp_uint_t n_pos_defaults, mp_uint_t n_kw_defaults);