mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
py/compile: Add option to allow compiling top-level await.
Enabled by MICROPY_COMPILE_ALLOW_TOP_LEVEL_AWAIT. When enabled, this means that scope such as module-level functions and REPL statements can yield. The outer C code must then handle this yielded generator. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -446,6 +446,11 @@
|
||||
#define MICROPY_DYNAMIC_COMPILER (0)
|
||||
#endif
|
||||
|
||||
// Whether the compiler allows compiling top-level await expressions
|
||||
#ifndef MICROPY_COMP_ALLOW_TOP_LEVEL_AWAIT
|
||||
#define MICROPY_COMP_ALLOW_TOP_LEVEL_AWAIT (0)
|
||||
#endif
|
||||
|
||||
// Whether to enable constant folding; eg 1+2 rewritten as 3
|
||||
#ifndef MICROPY_COMP_CONST_FOLDING
|
||||
#define MICROPY_COMP_CONST_FOLDING (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
|
||||
|
||||
Reference in New Issue
Block a user