Skip to content

Commit 57b28a4

Browse files
committed
Removes duplicate REGEX expressions
If this changes break something, it should only be in `textDocument/signatureHelp`
1 parent cbfcca4 commit 57b28a4

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

fortls/langserver.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@
5454
# Global regexes
5555
# TODO: I think this can be replaced by fortls.regex_patterns type & class
5656
TYPE_DEF_REGEX = re.compile(r"[ ]*(TYPE|CLASS)[ ]*\([a-z0-9_ ]*$", re.I)
57-
# TODO: I think this can be replaced by fortls.regex_patterns
58-
SCOPE_DEF_REGEX = re.compile(r"[ ]*(MODULE|PROGRAM|SUBROUTINE|FUNCTION)[ ]+", re.I)
59-
# TODO: I think this can be replaced by fortls.regex_patterns END_REGEx
60-
END_REGEX = re.compile(
61-
r"[ ]*(END)( |MODULE|PROGRAM|SUBROUTINE|FUNCTION|TYPE|DO|IF|SELECT)?", re.I
62-
)
6357

6458

6559
def init_file(filepath, pp_defs, pp_suffixes, include_dirs, sort):
@@ -814,7 +808,7 @@ def check_optional(arg, params):
814808
if line_prefix is None:
815809
return None
816810
# Test if scope declaration or end statement
817-
if SCOPE_DEF_REGEX.match(curr_line) or END_REGEX.match(curr_line):
811+
if FRegex.SCOPE_DEF.match(curr_line) or FRegex.END.match(curr_line):
818812
return None
819813
is_member = False
820814
try:

0 commit comments

Comments
 (0)