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:
Valerio Setti
2024-10-11 15:12:02 +02:00
parent bf87497fdc
commit c9d6bf4534
+1 -1
View File
@@ -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)