added fix for method declaration edgecase
This commit is contained in:
parent
21f120ce94
commit
254a7a7dff
1 changed files with 4 additions and 1 deletions
|
@ -96,7 +96,10 @@ def is_line_method_declaration(line:str, class_type:str) -> bool:
|
|||
:param line: The line to check.
|
||||
:return: True if the line is a method declaration, False otherwise.
|
||||
"""
|
||||
method_pattern = re.compile(r'^\s*(public|private|protected|\s)*\s*(static|final|\s)*\s*(\w[\w\d]*)\s+(\w[\w\d]*)\s*\(.*\)\s*{')
|
||||
# Sometimes these slip in as method declarations
|
||||
if "else if" in line:
|
||||
return False
|
||||
method_pattern = re.compile(r'^\s*(public|private|protected|\s)*\s*(static|final|\s)*\s*(\w[\w\d]*)\s+(\w[\w\d]*)\s*\(.*\)\s*(?:throws\s+\w[\w\d]*)?\s*{')
|
||||
|
||||
if class_type == "interface":
|
||||
method_pattern = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*\s+[a-zA-Z_][a-zA-Z0-9_]*\(\)\s*;$')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue