Modify extract_configs.py to deal with _u(X) macros (#222)

This commit is contained in:
Andrew Scheller 2021-03-04 14:42:03 +00:00 committed by GitHub
parent 6390fe56ae
commit 1a471f13bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,6 +171,11 @@ for dirpath, dirnames, filenames in os.walk(scandir):
m = re.match(r'^((0x)?\d+)u$', value.lower()) m = re.match(r'^((0x)?\d+)u$', value.lower())
if m: if m:
value = m.group(1) value = m.group(1)
else:
# discard any '_u(X)' macro
m = re.match(r'^_u\(((0x)?\d+)\)$', value.lower())
if m:
value = m.group(1)
if name not in all_defines: if name not in all_defines:
all_defines[name] = dict() all_defines[name] = dict()
if value not in all_defines[name]: if value not in all_defines[name]: