diff options
| author | Damien George <damien@micropython.org> | 2022-05-16 19:20:52 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-05-17 12:51:54 +1000 |
| commit | c49d5207e9437755be364639632be31c001955a8 (patch) | |
| tree | 3eb8ea6a6af8231c252b5e50173a5d34e5db2390 /py/mpconfig.h | |
| parent | b295b6f1f3dd529eea564b9e08b75c7ab4f48ce4 (diff) | |
py/persistentcode: Remove unicode feature flag from .mpy file.
Prior to this commit, even with unicode disabled .py and .mpy files could
contain unicode characters, eg by entering them directly in a string as
utf-8 encoded.
The only thing the compiler disallowed (with unicode disabled) was using
\uxxxx and \Uxxxxxxxx notation to specify a character within a string with
value >= 0x100; that would give a SyntaxError.
With this change mpy-cross will now accept \u and \U notation to insert a
character with value >= 0x100 into a string (because the -mno-unicode
option is now gone, there's no way to forbid this). The runtime will
happily work with strings with such characters, just like it already works
with strings with characters that were utf-8 encoded directly.
This change simplifies things because there are no longer any feature
flags in .mpy files, and any bytecode .mpy will now run on any target.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/mpconfig.h')
| -rw-r--r-- | py/mpconfig.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 8814d1f09..f9894b497 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -429,13 +429,6 @@ #define MICROPY_DYNAMIC_COMPILER (0) #endif -// Configure dynamic compiler macros -#if MICROPY_DYNAMIC_COMPILER -#define MICROPY_PY_BUILTINS_STR_UNICODE_DYNAMIC (mp_dynamic_compiler.py_builtins_str_unicode) -#else -#define MICROPY_PY_BUILTINS_STR_UNICODE_DYNAMIC MICROPY_PY_BUILTINS_STR_UNICODE -#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) |
