1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-05-28 16:21:27 +03:00

Merge pull request #6811 from davidhorstmann-arm/2.28-fix-check-names-enum-regex

[Backport 2.28] Fix an incorrect regex in check_names.py
This commit is contained in:
Gilles Peskine 2022-12-17 01:52:29 +01:00 committed by GitHub
commit cdae0d3752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -435,8 +435,11 @@ class CodeParser():
# Match typedefs and brackets only when they are at the
# beginning of the line -- if they are indented, they might
# be sub-structures within structs, etc.
optional_c_identifier = r"([_a-zA-Z][_a-zA-Z0-9]*)?"
if (state == states.OUTSIDE_KEYWORD and
re.search(r"^(typedef +)?enum +{", line)):
re.search(r"^(typedef +)?enum " + \
optional_c_identifier + \
r" *{", line)):
state = states.IN_BRACES
elif (state == states.OUTSIDE_KEYWORD and
re.search(r"^(typedef +)?enum", line)):