mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-07-31 16:27:46 +00:00
generate_test_code.py: simplify regex expression
"\w" already matches "[a-zA-Z0-9_]" so CONDITION_VALUE_REGEX can be simplified as proposed in this commit. Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
@@ -206,7 +206,7 @@ CONDITION_OPERATOR_REGEX = r'[!=]=|[<>]=?'
|
||||
# - math operators, i.e "+", "-", "*", "/"
|
||||
# - bitwise operators, i.e. "^", "|", "&", "~", "<<", ">>"
|
||||
# - parentheses, i.e. "()"
|
||||
CONDITION_VALUE_REGEX = r'[\d|\w|\(][\s_\(\)0-9a-zA-Z\+\-\*\/\^\|\&\~\<\>]*'
|
||||
CONDITION_VALUE_REGEX = r'[\w|\(][\s\w\(\)\+\-\*\/\^\|\&\~\<\>]*'
|
||||
CONDITION_REGEX = r'({})(?:\s*({})\s*({}))?$'.format(C_IDENTIFIER_REGEX,
|
||||
CONDITION_OPERATOR_REGEX,
|
||||
CONDITION_VALUE_REGEX)
|
||||
|
||||
Reference in New Issue
Block a user