Skip to content

Commit 131091d

Browse files
committed
fix: Add example to parenthetic_contentes docstring
1 parent 9f6d07d commit 131091d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fortls/helper_functions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ def get_keywords(keywords: list, keyword_info: dict = {}):
375375
def parenthetic_contents(string: str):
376376
"""Generate parenthesized contents in string as pairs
377377
(contents, start-position, level).
378+
379+
Examples
380+
--------
381+
>>> list(parenthetic_contents('character*(10*size(val(1), 2)) :: name'))
382+
[('1', 22, 2), ('val(1), 2', 18, 1), ('10*size(val(1), 2)', 10, 0)]
378383
"""
379384
stack = []
380385
for i, c in enumerate(string):

0 commit comments

Comments
 (0)