Improve function arguments parsing and checking
* always use "argN" names for unnamed arguments * honor space symbol between typename and "*", "&" symbols * fix indent errors
This commit is contained in:
@@ -116,6 +116,8 @@ def compareSignatures(f, s):
|
||||
sarg = arg[1]
|
||||
ftype = re.sub(r"\b(cv|std)::", "", (farg[0] or ""))
|
||||
stype = re.sub(r"\b(cv|std)::", "", (sarg[0] or ""))
|
||||
ftype = re.sub(r" (&|\*)$", "\\1", ftype)
|
||||
stype = re.sub(r" (&|\*)$", "\\1", stype)
|
||||
if ftype != stype:
|
||||
return False, "type of argument #" + str(idx+1) + " mismatch"
|
||||
fname = farg[1] or "arg" + str(idx)
|
||||
@@ -151,6 +153,7 @@ def formatSignature(s):
|
||||
if idx > 0:
|
||||
_str += ", "
|
||||
argtype = re.sub(r"\bcv::", "", arg[0])
|
||||
argtype = re.sub(r" (&|\*)$", "\\1", argtype)
|
||||
bidx = argtype.find('[')
|
||||
if bidx < 0:
|
||||
_str += argtype + " "
|
||||
|
Reference in New Issue
Block a user