From 81ab962437ca55cade4808529b494672b9a51c9f Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Mon, 17 Sep 2018 22:35:28 +0200 Subject: [PATCH] Correctly detect the visibility in fixed format case --- fortls/parse_fortran.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fortls/parse_fortran.py b/fortls/parse_fortran.py index aaa2673..11b7bc9 100644 --- a/fortls/parse_fortran.py +++ b/fortls/parse_fortran.py @@ -667,11 +667,12 @@ def process_file(file_str, close_open_scopes, path=None, fixed_format=False, deb if(debug): print('{1} !!! INCLUDE statement({0})'.format(line_number, line.strip())) # Look for visiblity statement - match = VIS_REGEX.match(line) + match = VIS_REGEX.match(line.strip()) if (match is not None): match_lower = match.group(0).lower() - trailing_line = line[match.end(0):] - mod_words = WORD_REGEX.findall(trailing_line) + trailing_line = line.strip()[match.end(0):] + line_no_comment = trailing_line.split('!')[0] + mod_words = WORD_REGEX.findall(line_no_comment) if len(mod_words) == 0: if match_lower == 'private': file_obj.current_scope.set_default_vis(-1) -- 2.7.4