Skip to content

Commit 5e2bc5a

Browse files
authored
Merge pull request #113 from Jorghi12/patch-2
Updating comments for find_closure_group.
2 parents e8b0772 + 124bbe9 commit 5e2bc5a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tools/amd_build/pyHIPIFY/hipify-python.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,17 @@ def find_kernel_bounds(string):
430430
def find_closure_group(input_string, start, group):
431431
"""Generalization for finding a balancing closure group
432432
433-
e.g. if group = ["(", ")"], then finds the first balanced parantheses.
433+
if group = ["(", ")"], then finds the first balanced parantheses.
434434
if group = ["{", "}"], then finds the first balanced bracket.
435+
436+
Given an input string, a starting position in the input string, and the group type,
437+
find_closure_group returns the positions of group[0] and group[1] as a tuple.
438+
439+
Example:
440+
find_closure_group("(hi)", 0, ["(", ")"])
441+
442+
Returns:
443+
0, 3
435444
"""
436445

437446
inside_parenthesis = False

0 commit comments

Comments
 (0)