This method is used to constrain the range in which parenthesis-balancing occurs.
Returns the prompt position with respect to pos. If pos is less than prompt-position, the result is 0; otherwise, the result is prompt-position.