Skip to content

Commit c9d6bf4

Browse files
committed
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]>
1 parent bf87497 commit c9d6bf4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/generate_test_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
# - math operators, i.e "+", "-", "*", "/"
207207
# - bitwise operators, i.e. "^", "|", "&", "~", "<<", ">>"
208208
# - parentheses, i.e. "()"
209-
CONDITION_VALUE_REGEX = r'[\d|\w|\(][\s_\(\)0-9a-zA-Z\+\-\*\/\^\|\&\~\<\>]*'
209+
CONDITION_VALUE_REGEX = r'[\w|\(][\s\w\(\)\+\-\*\/\^\|\&\~\<\>]*'
210210
CONDITION_REGEX = r'({})(?:\s*({})\s*({}))?$'.format(C_IDENTIFIER_REGEX,
211211
CONDITION_OPERATOR_REGEX,
212212
CONDITION_VALUE_REGEX)

0 commit comments

Comments
 (0)