Refactor the ARGTYPES regular expression in make-target-delegates.py
to eliminate '.*' for better control on what is matched. Also,
simplify the "E" match group, for which the optional SYMBOL becomes
redundant because that case can be matched by the "T" group.
After applying this patch, running './make-target-delegates.py' does not
change anything in 'target-delegates.c'.
Approved-By: Pedro Alves <pedro@palves.net>
+ METHOD_TRAILER
)
+# Space-separated symbols.
+CP_SYMBOLS = CP_SYMBOL + r"(\s+" + CP_SYMBOL + r")*"
+
# Regular expression used to dissect argument types.
ARGTYPES = re.compile(
"^("
+ r"(?P<E>enum\s+"
+ SYMBOL
- + r"\s*)("
- + SYMBOL
- + ")?"
- + r"|(?P<T>.*(enum\s+)?"
- + SYMBOL
- + r".*(\s|\*|&))"
+ + r")"
+ + r"|(?P<T>"
+ + CP_SYMBOLS
+ + r"(\s|\*|&)+)"
+ SYMBOL
+ ")$"
)