gdb: refactor make-target-delegates.py's ARGTYPES
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>
This commit is contained in:
parent
5baaed487b
commit
c7be5fa993
1 changed files with 7 additions and 6 deletions
|
@ -73,17 +73,18 @@ METHOD = re.compile(
|
||||||
+ METHOD_TRAILER
|
+ METHOD_TRAILER
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Space-separated symbols.
|
||||||
|
CP_SYMBOLS = CP_SYMBOL + r"(\s+" + CP_SYMBOL + r")*"
|
||||||
|
|
||||||
# Regular expression used to dissect argument types.
|
# Regular expression used to dissect argument types.
|
||||||
ARGTYPES = re.compile(
|
ARGTYPES = re.compile(
|
||||||
"^("
|
"^("
|
||||||
+ r"(?P<E>enum\s+"
|
+ r"(?P<E>enum\s+"
|
||||||
+ SYMBOL
|
+ SYMBOL
|
||||||
+ r"\s*)("
|
+ r")"
|
||||||
+ SYMBOL
|
+ r"|(?P<T>"
|
||||||
+ ")?"
|
+ CP_SYMBOLS
|
||||||
+ r"|(?P<T>.*(enum\s+)?"
|
+ r"(\s|\*|&)+)"
|
||||||
+ SYMBOL
|
|
||||||
+ r".*(\s|\*|&))"
|
|
||||||
+ SYMBOL
|
+ SYMBOL
|
||||||
+ ")$"
|
+ ")$"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue