1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 17:09:44 +00:00

scons: precompile regexp

Reflects micropython commit f6a1f18603de5c4d2321bcf4f967df298850e3f6
This commit is contained in:
Jan Pochyla 2018-06-13 16:29:44 +02:00 committed by Pavol Rusnak
parent 62111f240e
commit 658975d4fc

View File

@ -5,8 +5,9 @@ QSTR_BLACKLIST = set(['NULL', 'number_of'])
def process(source, target):
re_qstr = re.compile(r'MP_QSTR_[_a-zA-Z0-9]+')
for line in source:
for match in re.findall(r'MP_QSTR_[_a-zA-Z0-9]+', line):
for match in re_qstr.findall(line):
name = match.replace('MP_QSTR_', '')
if name not in QSTR_BLACKLIST:
target.write('Q(%s)\n' % name)