diff options
| author | Damien George <damien@micropython.org> | 2020-06-16 21:42:44 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2020-06-16 22:02:24 +1000 |
| commit | 178395031157f61af5426add2de1d76d91440b21 (patch) | |
| tree | 4f4898ff7f2e707e5b5e4a7245422b07689fb338 /py/lexer.h | |
| parent | 0fd91e39b1711772c88cfe4e0aaf817fe3387ba6 (diff) | |
py/compile: Implement PEP 572, assignment expressions with := operator.
The syntax matches CPython and the semantics are equivalent except that,
unlike CPython, MicroPython allows using := to assign to comprehension
iteration variables, because disallowing this would take a lot of code to
check for it.
The new compile-time option MICROPY_PY_ASSIGN_EXPR selects this feature and
is enabled by default, following MICROPY_PY_ASYNC_AWAIT.
Diffstat (limited to 'py/lexer.h')
| -rw-r--r-- | py/lexer.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/py/lexer.h b/py/lexer.h index b9f97013a..91767a44b 100644 --- a/py/lexer.h +++ b/py/lexer.h @@ -96,6 +96,7 @@ typedef enum _mp_token_kind_t { MP_TOKEN_KW_WITH, MP_TOKEN_KW_YIELD, + MP_TOKEN_OP_ASSIGN, MP_TOKEN_OP_TILDE, // Order of these 6 matches corresponding mp_binary_op_t operator |
