Skip to content

Commit

Permalink
Adds docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
gnikit committed Feb 25, 2022
1 parent 3258daf commit bba27fc
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions fortls/parse_fortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit bba27fc

Please sign in to comment.