Skip to content

Commit 10d9287

Browse files
committed
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.
1 parent 2f5ec1c commit 10d9287

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/genlast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from makeqstrdefs import qstr_unescape, QSTRING_BLOCK_LIST
1313

1414
re_line = re.compile(r"#[line]*\s(\d+)\s\"([^\"]+)\"", re.DOTALL)
15-
re_qstr = re.compile(r"MP_QSTR_[_a-zA-Z0-9]+", re.DOTALL)
15+
re_qstr = re.compile(r"\bMP_QSTR_[_a-zA-Z0-9]+", re.DOTALL)
1616
re_translate = re.compile(r"translate\(\"((?:(?=(\\?))\2.)*?)\"\)", re.DOTALL)
1717

1818

0 commit comments

Comments
 (0)