Skip to main content

walk_to_end

The iterator is currently inside a capturing group. Walk to the close of this group, skipping over any nested groups and handling escaped parentheses correctly.

def walk_to_end(
ch: string,
input_iter: iterator
) - > null

The iterator is currently inside a capturing group. Walk to the close of this group, skipping over any nested groups and handling escaped parentheses correctly.

Parameters

NameTypeDescription
chstringThe current character being processed to determine the initial nesting level.
input_iteriteratorAn iterator yielding tuples of (character, is_escaped) used to traverse the remaining regex pattern.

Returns

TypeDescription
nullReturns nothing; the function exits once the matching closing parenthesis for the current nesting level is found.