mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
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
@ -73,17 +73,18 @@ METHOD = re.compile(
|
||||
+ 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
|
||||
+ ")$"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user