py: Allow to properly disable builtin "set" object.
This patch makes MICROPY_PY_BUILTINS_SET compile-time option fully disable the builtin set object (when set to 0). This includes removing set constructor/comprehension from the grammar, the compiler and the emitters. Now, enabling set costs 8168 bytes on unix x64, and 3576 bytes on stmhal.
This commit is contained in:
@@ -128,8 +128,10 @@ typedef struct _emit_method_table_t {
|
||||
void (*build_map)(emit_t *emit, mp_uint_t n_args);
|
||||
void (*store_map)(emit_t *emit);
|
||||
void (*map_add)(emit_t *emit, mp_uint_t map_stack_index);
|
||||
#if MICROPY_PY_BUILTINS_SET
|
||||
void (*build_set)(emit_t *emit, mp_uint_t n_args);
|
||||
void (*set_add)(emit_t *emit, mp_uint_t set_stack_index);
|
||||
#endif
|
||||
void (*build_slice)(emit_t *emit, mp_uint_t n_args);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user