diff options
author | Damien George <damien@micropython.org> | 2022-03-16 00:22:58 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2022-03-16 00:41:10 +1100 |
commit | 3c7cab4e98a31649ed1bc2e728d610856382d6f5 (patch) | |
tree | 2dd27b29992d82998a9853af8f356b8c258bf1f0 /py/parse.h | |
parent | 65851ebb5126d4940e91c9f2c1d13b4e10753579 (diff) |
py/parse: Put const bytes objects in parse tree as const object.
Instead of as an intermediate qstr, which may unnecessarily intern the data
of the bytes object.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'py/parse.h')
-rw-r--r-- | py/parse.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/py/parse.h b/py/parse.h index a6eb38004..9c327c28b 100644 --- a/py/parse.h +++ b/py/parse.h @@ -39,15 +39,13 @@ struct _mp_lexer_t; // - xxxx...xx00: pointer to mp_parse_node_struct_t // - xx...xx0010: an identifier; bits 4 and above are the qstr // - xx...xx0110: a string; bits 4 and above are the qstr holding the value -// - xx...xx1010: a string of bytes; bits 4 and above are the qstr holding the value -// - xx...xx1110: a token; bits 4 and above are mp_token_kind_t +// - xx...xx1010: a token; bits 4 and above are mp_token_kind_t #define MP_PARSE_NODE_NULL (0) #define MP_PARSE_NODE_SMALL_INT (0x1) #define MP_PARSE_NODE_ID (0x02) #define MP_PARSE_NODE_STRING (0x06) -#define MP_PARSE_NODE_BYTES (0x0a) -#define MP_PARSE_NODE_TOKEN (0x0e) +#define MP_PARSE_NODE_TOKEN (0x0a) typedef uintptr_t mp_parse_node_t; // must be pointer size |