[sipify] allow namespace/class spec in static const declarations

This commit is contained in:
Denis Rouzaud 2024-11-18 10:00:48 +01:00 committed by GitHub
parent 25ec551124
commit a135e21727
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2246,9 +2246,9 @@ while CONTEXT.line_idx < CONTEXT.line_count:
# TODO needs fixing!!
# original perl regex was:
# ^(?<staticconst> *(?<static>static )?const \w+(?:<(?:[\w<>, ]|::)+>)? \w+)(?: = [^()]+?(\((?:[^()]++|(?3))*\))?[^()]*?)?(?<endingchar>[|;]) *(\/\/.*?)?$
# ^(?<staticconst> *(?<static>static )?const (\w+::)*\w+(?:<(?:[\w<>, ]|::)+>)? \w+)(?: = [^()]+?(\((?:[^()]++|(?3))*\))?[^()]*?)?(?<endingchar>[|;]) *(\/\/.*?)?$
match = re.search(
r'^(?P<staticconst> *(?P<static>static )?const \w+(?:<(?:[\w<>, ]|::)+>)? \w+)(?: = [^()]+?(\((?:[^()]|\([^()]*\))*\))?[^()]*?)?(?P<endingchar>[|;]) *(//.*)?$',
r'^(?P<staticconst> *(?P<static>static )?const (\w+::)*\w+(?:<(?:[\w<>, ]|::)+>)? \w+)(?: = [^()]+?(\((?:[^()]|\([^()]*\))*\))?[^()]*?)?(?P<endingchar>[|;]) *(//.*)?$',
CONTEXT.current_line
)
if match: