mirror of
https://github.com/cuberite/polarssl.git
synced 2025-12-11 00:09:48 -05:00
Merge pull request #6810 from davidhorstmann-arm/fix-check-names-enum-regex
Fix an incorrect regex in check_names.py
This commit is contained in:
commit
77f9984cc3
@ -444,8 +444,11 @@ class CodeParser():
|
|||||||
# Match typedefs and brackets only when they are at the
|
# Match typedefs and brackets only when they are at the
|
||||||
# beginning of the line -- if they are indented, they might
|
# beginning of the line -- if they are indented, they might
|
||||||
# be sub-structures within structs, etc.
|
# be sub-structures within structs, etc.
|
||||||
|
optional_c_identifier = r"([_a-zA-Z][_a-zA-Z0-9]*)?"
|
||||||
if (state == states.OUTSIDE_KEYWORD and
|
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
|
state = states.IN_BRACES
|
||||||
elif (state == states.OUTSIDE_KEYWORD and
|
elif (state == states.OUTSIDE_KEYWORD and
|
||||||
re.search(r"^(typedef +)?enum", line)):
|
re.search(r"^(typedef +)?enum", line)):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user