py: Add support for __debug__ constant.
__debug__ now resolves to True or False. Its value needs to be set by
mp_set_debug().
TODO: call mp_set_debug in unix/ port.
TODO: optimise away "if False:" statements in compiler.
diff --git a/py/runtime.c b/py/runtime.c
index 8852b7d..3cdbd22 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -69,11 +69,14 @@
};
void mp_init(void) {
- // call port specific initialization if any
+ // call port specific initialization if any
#ifdef MICROPY_PORT_INIT_FUNC
MICROPY_PORT_INIT_FUNC;
#endif
+ // __debug__ enabled by default
+ mp_set_debug(true);
+
mp_emit_glue_init();
// init global module stuff