Skip to content

Updating comments for find_closure_group. #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tools/amd_build/pyHIPIFY/hipify-python.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,17 @@ def find_kernel_bounds(string):
def find_closure_group(input_string, start, group):
"""Generalization for finding a balancing closure group

e.g. if group = ["(", ")"], then finds the first balanced parantheses.
if group = ["(", ")"], then finds the first balanced parantheses.
if group = ["{", "}"], then finds the first balanced bracket.

Given an input string, a starting position in the input string, and the group type,
find_closure_group returns the positions of group[0] and group[1] as a tuple.

Example:
find_closure_group("(hi)", 0, ["(", ")"])

Returns:
0, 3
"""

inside_parenthesis = False
Expand Down