Skip to content

Commit 9f6d07d

Browse files
committed
fix: Fix docstrings examples
1 parent cd40a23 commit 9f6d07d

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

fortls/helper_functions.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ def separate_def_list(test_str: str) -> list[str] | None:
136136
137137
Examples
138138
--------
139-
>>> separate_def_list("var1, var2, var3")
140-
["var1", "var2", "var3"]
139+
>>> separate_def_list('var1, var2, var3')
140+
['var1', 'var2', 'var3']
141141
142142
143-
>>> separate_def_list("var, init_var(3) = [1,2,3], array(3,3)")
144-
["var", "init_var", "array"]
143+
>>> separate_def_list('var, init_var(3) = [1,2,3], array(3,3)')
144+
['var', 'init_var(3) = [1,2,3]', 'array(3,3)']
145145
"""
146146
stripped_str = strip_strings(test_str)
147147
paren_count = 0
@@ -208,17 +208,17 @@ def find_paren_match(string: str) -> int:
208208
209209
Examples
210210
--------
211-
>>> find_paren_match("a, b)")
211+
>>> find_paren_match('a, b)')
212212
4
213213
214214
Multiple parenthesis that are closed
215215
216-
>>> find_paren_match("a, (b, c), d)")
216+
>>> find_paren_match('a, (b, c), d)')
217217
12
218218
219219
If the outermost parenthesis is not closed function returns -1
220220
221-
>>> find_paren_match("a, (b, (c, d)")
221+
>>> find_paren_match('a, (b, (c, d)')
222222
-1
223223
"""
224224
paren_count = 1
@@ -401,12 +401,12 @@ def get_paren_substring(string: str) -> str | None:
401401
402402
Examples
403403
--------
404-
>>> get_paren_substring("some line(a, b, (c, d))")
405-
"a, b, (c, d)"
404+
>>> get_paren_substring('some line(a, b, (c, d))')
405+
'a, b, (c, d)'
406406
407407
If the line has incomplete parenthesis however, ``None`` is returned
408-
>>> get_paren_substring("some line(a, b")
409-
None
408+
>>> get_paren_substring('some line(a, b') is None
409+
True
410410
"""
411411
i1 = string.find("(")
412412
i2 = string.rfind(")")
@@ -432,13 +432,13 @@ def get_paren_level(line: str) -> tuple[str, list[Range]]:
432432
433433
Examples
434434
--------
435-
>>> get_paren_level("CALL sub1(arg1,arg2")
435+
>>> get_paren_level('CALL sub1(arg1,arg2')
436436
('arg1,arg2', [Range(start=10, end=19)])
437437
438438
If the range is interrupted by parenthesis, another Range variable is used
439439
to mark the ``start`` and ``end`` of the argument
440440
441-
>>> get_paren_level("CALL sub1(arg1(i),arg2")
441+
>>> get_paren_level('CALL sub1(arg1(i),arg2')
442442
('arg1,arg2', [Range(start=10, end=14), Range(start=17, end=22)])
443443
444444
"""
@@ -493,16 +493,16 @@ def get_var_stack(line: str) -> list[str]:
493493
494494
Examples
495495
--------
496-
>>> get_var_stack("myvar%foo%bar")
497-
["myvar", "foo", "bar"]
496+
>>> get_var_stack('myvar%foo%bar')
497+
['myvar', 'foo', 'bar']
498498
499-
>>> get_var_stack("myarray(i)%foo%bar")
500-
["myarray", "foo", "bar"]
499+
>>> get_var_stack('myarray(i)%foo%bar')
500+
['myarray', 'foo', 'bar']
501501
502-
In this case it will operate at the end of the string i.e. ``"this%foo"``
502+
In this case it will operate at the end of the string i.e. ``'this%foo'``
503503
504-
>>> get_var_stack("CALL self%method(this%foo")
505-
["this", "foo"]
504+
>>> get_var_stack('CALL self%method(this%foo')
505+
['this', 'foo']
506506
"""
507507
if len(line) == 0:
508508
return [""]

0 commit comments

Comments
 (0)