From 10d92873c38211db27aa58dd1114298994543f7d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 8 Nov 2022 11:21:03 -0600 Subject: [PATCH] Don't generate QSTRs for wrong identifiers MP_REGISTER_MODULE would use identifiers like "MODULE_DEF_MP_QSTR___FUTURE__" which would in turn cause a QSTR to be generated for it. This wasn't desirable, because the qstr would never be used. This clears out quite a bit of flash storage on the proxlight trinkey. --- py/genlast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/genlast.py b/py/genlast.py index ad44745d97..460271af81 100644 --- a/py/genlast.py +++ b/py/genlast.py @@ -12,7 +12,7 @@ import subprocess from makeqstrdefs import qstr_unescape, QSTRING_BLOCK_LIST re_line = re.compile(r"#[line]*\s(\d+)\s\"([^\"]+)\"", re.DOTALL) -re_qstr = re.compile(r"MP_QSTR_[_a-zA-Z0-9]+", re.DOTALL) +re_qstr = re.compile(r"\bMP_QSTR_[_a-zA-Z0-9]+", re.DOTALL) re_translate = re.compile(r"translate\(\"((?:(?=(\\?))\2.)*?)\"\)", re.DOTALL)