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.
diff --git a/py/map.c b/py/map.c
index a063258..22580de 100644
--- a/py/map.c
+++ b/py/map.c
@@ -253,6 +253,8 @@
/******************************************************************************/
/* set */
+#if MICROPY_PY_BUILTINS_SET
+
void mp_set_init(mp_set_t *set, mp_uint_t n) {
set->alloc = n;
set->used = 0;
@@ -368,6 +370,8 @@
set->table = NULL;
}
+#endif // MICROPY_PY_BUILTINS_SET
+
#if defined(DEBUG_PRINT) && DEBUG_PRINT
void mp_map_dump(mp_map_t *map) {
for (mp_uint_t i = 0; i < map->alloc; i++) {