Skip to content

Commit 00dce98

Browse files
authored
Merge pull request numpy#19913 from DimitriPapadopoulos/lgtm_error
MAINT: Fix LGTM.com error: Unmatchable caret in regular expression
2 parents d86652f + 34efd69 commit 00dce98

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

numpy/linalg/lapack_lite/clapack_scrub.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,18 @@ def OutOfHeader(line):
228228
return lines.getValue()
229229

230230
def removeSubroutinePrototypes(source):
231-
expression = re.compile(
232-
r'/\* Subroutine \*/^\s*(?:(?:inline|static)\s+){0,2}(?!else|typedef|return)\w+\s+\*?\s*(\w+)\s*\([^0]+\)\s*;?'
233-
)
234-
lines = LineQueue()
235-
for line in UStringIO(source):
236-
if not expression.match(line):
237-
lines.add(line)
238-
239-
return lines.getValue()
231+
# This function has never worked as advertised by its name:
232+
# - "/* Subroutine */" declarations may span multiple lines and
233+
# cannot be matched by a line by line approach.
234+
# - The caret in the initial regex would prevent any match, even
235+
# of single line "/* Subroutine */" declarations.
236+
#
237+
# While we could "fix" this function to do what the name implies
238+
# it should do, we have no hint of what it should really do.
239+
#
240+
# Therefore we keep the existing (non-)functionaity, documenting
241+
# this function as doing nothing at all.
242+
return source
240243

241244
def removeBuiltinFunctions(source):
242245
lines = LineQueue()

0 commit comments

Comments
 (0)