mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1184959 part 0 - check_macroassembler_style: Remove default values from the signature. r=h4writer
This commit is contained in:
parent
5e3a2f2da7
commit
01f83d1114
@ -33,13 +33,20 @@ architecture_independent = set([ 'generic' ])
|
||||
all_architecture_names = set([ 'x86', 'x64', 'arm', 'arm64', 'mips32' ])
|
||||
all_shared_architecture_names = set([ 'x86_shared', 'arm', 'arm64', 'mips32' ])
|
||||
|
||||
reBeforeArg = "(?<=[(,\s])"
|
||||
reArgType = "(?P<type>[\w\s:*&]+)"
|
||||
reArgName = "(?P<name>\s\w+)"
|
||||
reArgDefault = "(?P<default>(?:\s=[^,)]+)?)"
|
||||
reAfterArg = "(?=[,)])"
|
||||
reMatchArg = re.compile(reBeforeArg + reArgType + reArgName + reArgDefault + reAfterArg)
|
||||
|
||||
def get_normalized_signatures(signature, fileAnnot = None):
|
||||
# Remove semicolon.
|
||||
signature = signature.replace(';', ' ')
|
||||
# Normalize spaces.
|
||||
signature = re.sub(r'\s+', ' ', signature).strip()
|
||||
# Remove argument names.
|
||||
signature = re.sub(r'(?P<type>(?:[(]|,\s)[\w\s:*&]+)(?P<name>\s\w+)(?=[,)])', '\g<type>', signature)
|
||||
# Match arguments, and keep only the type.
|
||||
signature = reMatchArg.sub('\g<type>', signature)
|
||||
# Remove class name
|
||||
signature = signature.replace('MacroAssembler::', '')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user