From bba27fcbb9dc349ff871a5914b42b7caa0acf6e3 Mon Sep 17 00:00:00 2001 From: gnikit Date: Fri, 25 Feb 2022 14:03:38 +0000 Subject: [PATCH] Adds docstring --- fortls/parse_fortran.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/fortls/parse_fortran.py b/fortls/parse_fortran.py index 3442d38e..8b5993b9 100644 --- a/fortls/parse_fortran.py +++ b/fortls/parse_fortran.py @@ -715,8 +715,24 @@ def find_external_type( def find_external_attr( file_ast: fortran_ast, name_stripped: str, new_var: fortran_var ) -> bool: - """Check if this NORMAL Fortran variable is in the - external_objs with only EXTERNAL as its type""" + """Check if this NORMAL Fortran variable is in the external_objs with only + ``EXTERNAL`` as its type. Used to detect seperated ``EXTERNAL`` declarations. + + Parameters + ---------- + file_ast : fortran_ast + AST file + name_stripped : str + Variable name, stripped + new_var : fortran_var + Fortran variable to check against + + Returns + ------- + bool + True if only a single ``EXTERNAL`` definition is encountered False + for everything else, which will cause a diagnostic error to be raised + """ counter = 0 for v in file_ast.external_objs: if v.name != name_stripped: